Kamikaze94 / WolfHUD

Payday 2 HUD
483 stars 236 forks source link

Fix crash regarding nil value for job_heat #955

Open Wh1t3st4r opened 1 year ago

Wh1t3st4r commented 1 year ago

Fix implemented and orientated by "Shaklin" in the "Show Contract XP" mod imported to counter a crash with custom maps.

Description

The only actual change is before directly getting the 'heat to experience' value, a check is done to verify if the 'job heat' value is nil or not; if it is nil, it's value is substituted to "0" to fix this crash that happens in: "[string "lib/managers/jobmanager.lua"]:502: attempt to compare nil with number". This fix fixes any problems with custom heists of any sorts and any kind of heist XP calculation.

Fixes # #952

Type of change

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

Game is running in the newest version with two custom maps (Enemy Spawner & Greenscreen) localized in "Custom Heists" and "Events" tab

Before Fix

After Fix

Checklist:

cucumber-dragon commented 1 year ago

I have tested it and it works! Before updating the file I couldn't use the mod on any custom heists. In fact, whenever I have a custom heist installed, the game crashes when I click on the contract broker button. After the fix however, I can use wolfhud without any issues!

Wh1t3st4r commented 1 year ago

I have tested it and it works! Before updating the file I couldn't use the mod on any custom heists. In fact, whenever I have a custom heist installed, the game crashes when I click on the contract broker button. After the fix however, I can use wolfhud without any issues!

Perfecto mate! It'll probably not be implemented in a good while for the main mod, but as long as that is the case the fork will be here to help on that, I really hope @Kamikaze94 gets back on github to at least pull merge some fixes.

king8-savage commented 1 year ago

hello i'm having the same issue has this been fixed if not how can i implement it to my mod?

Wh1t3st4r commented 1 year ago

It has not Yet been merged, but you can head to my branch and download the mod from there, it'll be the same as installing the mod you already have.

On Wed, Apr 5, 2023, 12:21 AM king8-savage @.***> wrote:

hello i'm having the same issue has this been fixed if not how can i implement it to my mod?

— Reply to this email directly, view it on GitHub https://github.com/Kamikaze94/WolfHUD/pull/955#issuecomment-1496868580, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQVTXNGMRGUYUZJUOWBAQQDW7TQL3ANCNFSM6AAAAAAURRXVQ4 . You are receiving this because you authored the thread.Message ID: @.***>

king8-savage commented 1 year ago

hey man thank you it fixed my issue aswell only ""issue"" is that the download manager always thinks it's not updated to the latest version

Wh1t3st4r commented 1 year ago

hey man thank you it fixed my issue aswell only ""issue"" is that the download manager always thinks it's not updated to the latest version

Glad it helped mate! Yeah I need to work on that if it will become standalone, I was hoping @Kamikaze94 would return and implement the fix but in case other problems can get fixed I could probably insert the same update feature to that branch. In any case try to ignore it for the time being, try not to update it as it would reverse the changes back to the original!

Shadeloid commented 1 year ago

Which file do i have to edit? job_heat? Where's that? Appdata?

Wh1t3st4r commented 1 year ago

Which file do i have to edit? job_heat? Where's that? Appdata?

Hop into my branch download and install it the same way you would with the original one, It'll come with the fix without any tinkering necessary.