morerokk / IreNFist

A continuation/fix of the IreNFist mod for PAYDAY 2
MIT License
4 stars 2 forks source link

Issue with Murkywater Heists #24

Closed Bwamo closed 4 years ago

Bwamo commented 4 years ago

Crash seems to occur after awhile with any Murkywater related heists. Client joined games don't seem to have an issue while self-hosted/offline games do.

[string "lib/units/enemies/cop/copdamage.lua"]:2170: attempt to index a nil value

SCRIPT STACK

original() lib/units/enemies/cop/copdamage.lua:511
damage_bullet() @mods/base/req/core/Hooks.lua:188
give_impact_damage() lib/units/weapons/raycastweaponbase.lua:2224
on_collision() lib/units/weapons/raycastweaponbase.lua:2137
_fire_raycast() lib/units/weapons/newnpcraycastweaponbase.lua:563
orig_fire() lib/units/weapons/raycastweaponbase.lua:468
original_fire() @mods/AFSF2/AutoFireSoundFix.lua:56
fire_original() @mods/IRE AND FIST REBORN/lua/raycast.lua:166
fire() @mods/IRE AND FIST REBORN/lua/BurstFire.lua:150
trigger_held() lib/units/weapons/newnpcraycastweaponbase.lua:203
update() lib/units/enemies/cop/actions/upper_body/copactionshoot.lua:349
_upd_actions() lib/units/enemies/cop/copmovement.lua:647
update() lib/units/enemies/cop/copmovement.lua:610
lib/units/player_team/teamaimovement.lua:436
Bwamo commented 4 years ago

Using only IreNFist and Beardlib, I churned out this script stack

Application has crashed: C++ exception
[string "lib/units/enemies/cop/copdamage.lua"]:2170: attempt to index a nil value
SCRIPT STACK

original() lib/units/enemies/cop/copdamage.lua:511
damage_bullet() @mods/base/req/core/Hooks.lua:188
give_impact_damage() lib/units/weapons/raycastweaponbase.lua:2224
on_collision() lib/units/weapons/raycastweaponbase.lua:2137
_fire_raycast() @mods/IRE AND FIST REBORN/lua/raycast.lua:340
original_fire() lib/units/weapons/raycastweaponbase.lua:468
fire() @mods/IRE AND FIST REBORN/lua/raycast.lua:166
fire_original() @mods/BeardLib/Hooks/Fixes.lua:402
fire() @mods/IRE AND FIST REBORN/lua/BurstFire.lua:150
trigger_pressed() lib/units/weapons/raycastweaponbase.lua:375
original() @mods/IRE AND FIST REBORN/lua/playerstandard.lua:1199
_check_action_primary_attack() @mods/base/req/core/Hooks.lua:265
_update_check_actions() lib/units/beings/player/states/playerstandard.lua:948
original() lib/units/beings/player/states/playerstandard.lua:435
original() @mods/base/req/core/Hooks.lua:188
update_original() @mods/base/req/core/Hooks.lua:265
update() @mods/IRE AND FIST REBORN/lua/BurstFire.lua:350
original() lib/units/beings/player/playermovement.lua:271
@mods/base/req/core/Hooks.lua:265
morerokk commented 4 years ago

Dang, looks like this might be related to the cops being teamless on occasion. I put in several safety checks to prevent this but it still happens sometimes.

This is actually a bug in the vanilla game, it just only happens on HRT's or custom-made squads. I'll try to fix it. In the meantime, were you hosting or joining?

Bwamo commented 4 years ago

Joining seems to never have a problem at all. I've encountered this problem hosting any heist that uses Murkywater enemies.

This is actually a bug in the vanilla game, it just only happens on HRT's or custom-made squads. I'll try to fix it. In the meantime, were you hosting or joining?

This is probably why joining other players' games works fine and doesn't cause crashes.

morerokk commented 4 years ago

The next update will have some extra sanity checks on all damage_bullet calls which assigns a default team to the cops. This really oughta not be happening anymore but you never know.

morerokk commented 4 years ago

Update pushed, if it happens again can you upload another report? I might have to add in additional debug measures to get clearer crash logs.

Bwamo commented 4 years ago

Was able to trigger the crash again. but at least whilst using carl's st ar-15

Application has crashed: C++ exception [string "lib/units/enemies/cop/copdamage.lua"]:2170: attempt to index a nil value

preview_55998_1563234435_027641c4d17c222a7c30e21c67c6e604

morerokk commented 4 years ago

I'll make a debugger mod in a bit. If you install that, it should act the same but if any crashes happen I can tell where they're happening. It works fine for me.

Does this also happen if you disable the assault tweaks in options?

morerokk commented 4 years ago

@Bwamo can you install this mod and try to trigger the crash again? I'm fairly positive that this might actually be an issue with Shockproof Ace, but this mod will tell me for absolute sure. Just upload the crash.txt if it happens again and I should be able to tell what the problem is.

CopDamageDebug.zip

Bwamo commented 4 years ago

yoink

Also, running with assault tweaks off still triggered the issue.

Application has crashed: C++ exception
mods/CopDamageDebug/copdamage.lua:815: attempt to index a nil value

SCRIPT STACK

original() lib/units/enemies/cop/copdamage.lua:511
damage_bullet() @mods/base/req/core/Hooks.lua:188
give_impact_damage() lib/units/weapons/raycastweaponbase.lua:2224
on_collision() lib/units/weapons/raycastweaponbase.lua:2137
_fire_raycast() @mods/IRE AND FIST REBORN/lua/raycast.lua:340
original_fire() lib/units/weapons/raycastweaponbase.lua:468
fire() @mods/IRE AND FIST REBORN/lua/raycast.lua:166
fire_original() @mods/BeardLib/Hooks/Fixes.lua:402
fire() @mods/IRE AND FIST REBORN/lua/BurstFire.lua:150
trigger_pressed() lib/units/weapons/raycastweaponbase.lua:375
original() @mods/IRE AND FIST REBORN/lua/playerstandard.lua:1199
_check_action_primary_attack() @mods/base/req/core/Hooks.lua:265
_update_check_actions() lib/units/beings/player/states/playerstandard.lua:948
original() lib/units/beings/player/states/playerstandard.lua:435
original() @mods/base/req/core/Hooks.lua:188
update_original() @mods/base/req/core/Hooks.lua:265
update() @mods/IRE AND FIST REBORN/lua/BurstFire.lua:350
original() lib/units/beings/player/playermovement.lua:271
@mods/base/req/core/Hooks.lua:265
morerokk commented 4 years ago

Beautiful, thanks! I'll get on it.

morerokk commented 4 years ago

Looks to be an issue with helmets popping off on headshots (or some other form of head gadget/helmet related thing), I have no idea why that happens but I assume that's just some iffy thing in the Murkywater troops. I'll just patch in a workaround.

morerokk commented 4 years ago

A fix has been pushed, if it happens again please comment on this issue (or open a new one and reference this issue). You can leave the CopDamageDebug mod installed.

Bwamo commented 4 years ago

I'll keep testing murkywater heists out and see if I can trigger them. thanks for the fix