JamesWilko / Payday-2-BLT-Lua

Mods folder that controls the ingame aspects of the Payday 2 BLT.
MIT License
16 stars 26 forks source link

CoreClass.overwrite_class function not working #26

Closed Kamikaze94 closed 7 years ago

Kamikaze94 commented 7 years ago

When shooting at targets (Wick's shooting range) in safehouse, you'll get the following crashlog:

[string "lib/managers/mission/elementunitdamage.lua"]:88: attempt to call method 'override_value_on_element_type' (a nil value)

SCRIPT STACK

clbk() lib/managers/mission/elementunitdamage.lua:72 call() lib/utils/eventlistenerholder.lua:33 damage_damage() lib/units/unitdamage.lua:41 on_collision() lib/units/weapons/raycastweaponbase.lua:2068 _fire_raycast() lib/units/weapons/raycastweaponbase.lua:617 fire_original() lib/units/weapons/raycastweaponbase.lua:459 fire() @mods/WolfHUD/lua/BurstFire.lua:87 trigger_pressed() lib/units/weapons/raycastweaponbase.lua:356 _check_action_primary_attack() lib/units/beings/player/states/playerstandard.lua:4690 _update_check_actions() lib/units/beings/player/states/playerstandard.lua:885 update_original() lib/units/beings/player/states/playerstandard.lua:413 update() @mods/WolfHUD/lua/BurstFire.lua:196 lib/units/beings/player/playermovement.lua:275

The class ElementUnitDamage calls the function "override_value_on_element_type", but doesn't define it. If we look at the parentclass of ElementUnitDamage, we find CoreMissionScriptElement.MissionScriptElement, which doesn't define the function as well. Now, there is a MissionScriptElement in 'lib/managers/mission' as well, and that one does declare the funtion and gets used by the call "CoreClass.override_class(CoreMissionScriptElement.MissionScriptElement, MissionScriptElement)" at the end of the file.