PAYDAY 2

PAYDAY 2

View Stats:
DeadMansChest 31 Jul, 2017 @ 10:02am
(U167.1) Non-vanilla magazines crash others/you when you/others reload (Started with the Desync Update)
First off, this is a bug related to modding, but with that in mind, it's acting as a really weird hinderance for modders and mod users that I'm 90% sure wasn't intended when the Desync update was rolled out.

The game will crash other players if you're using a custom magazine and reload and vice versa if another player is using a custom magazine mod and they reload.

If:
  • a custom magazine's part ID doesn't exist according you or another player, depending on who has and doesn't have the custom mag mod

    OR

  • If all players have the custom mag, but the "uses_parts" index value for the weapon is different between them
the game will just leave an empty space in the 3rd person model for whoever didn't have the magazine mod with that specific index value. Didn't matter enough since it never led to crashing.

As of the Desync update, magazine dropping was added in and let's just say the game doesn't like trying to spawn in nothing. Players affected by the once minor bug above will be met with this in their crash log when the player(s) that has/have an invisible mag reload:
attempt to index field '_magazine_data' (a nil value)

I found that two of the functions responsible for handing the dropped mag stuff, "anim_clbk_spawn_dropped_magazine" and "anim_clbk_show_magazine_in_hand", both in "HuskPlayerMovement", lack any fallback code when a magazine mod just doesn't exist for you or other players.

Last edited by DeadMansChest; 5 Dec, 2017 @ 7:14am
< >
Showing 1-9 of 9 comments
grishenko [NOR] 31 Jul, 2017 @ 10:54am 
Yeah, typical Overkill coding-standards. At the end of a switch statement just add exit (0), because that should never happen...
BBK 1 Aug, 2017 @ 12:36am 
Thanks for reporting this issue, i'll inform the developers about this matter.
OVERKILL_Miki 2 Aug, 2017 @ 12:28am 
Thanks for the report, we will take a look at this.
DeadMansChest 26 Aug, 2017 @ 9:16pm 
Anything on this? This made pre-existing mods that modify magazines a pain to work with.
Rokk 29 Oct, 2017 @ 3:29pm 
Is this still an issue? Seems like something that should be addressed. Other people's mods should not be able to crash your game like this.
Last edited by Rokk; 29 Oct, 2017 @ 3:30pm
Alcat101 16 Nov, 2017 @ 10:49am 
Does this issue got fixed in the latest Update 165?
I have some custom magazine mod that I'm pretty sure will crash other before the Update 165, and after updating, and testing the mod, the other dont crash...
This is kinda confusing since I test the mod with the intent to crash other...
NewPJzuza 4 Dec, 2017 @ 10:33am 
Application has crashed: C++ exception [string "lib/units/beings/player/huskplayermovement.lua"]:3669: attempt to index field '_magazine_data' (a nil value)
It seems this is still be a thing on U167.1 Although I can't confirm it since I just got this crashed today and none of my friends used custom magazine mods
Alcat101 4 Dec, 2017 @ 10:44am 
After another testing with custom magazine, it appears so that issues with custom magazine isn't fixed yet..
So I've updated all of my custom magazine mod with a wordaround that should at least work and not crashing other.
Hoppip 29 Jan, 2018 @ 2:07pm 
This is part of HuskPlayerMovement:anim_clbk_spawn_dropped_magazine()
if not self._magazine_data then local w_td_crew = self:_equipped_weapon_crew_tweak_data() if not w_td_crew or not w_td_crew.pull_magazine_during_reload then return end local attach_bone = Idstring("LeftHandMiddle2") local bone_hand = self._unit:get_object(attach_bone) self:anim_clbk_show_magazine_in_hand() if bone_hand then mvec3_set(tmp_vec1, self._magazine_data.unit:position()) mvec3_sub(tmp_vec1, self._magazine_data.unit:oobb():center()) mvec3_add(tmp_vec1, bone_hand:position()) self._magazine_data.unit:set_position(tmp_vec1) end ref_unit = self._magazine_data.part_unit allow_throw = false end
I'm pretty sure you shouldn't access _magazine_data after checking that it is NOT defined.
< >
Showing 1-9 of 9 comments
Per page: 1530 50

Date Posted: 31 Jul, 2017 @ 10:02am
Posts: 9