Project Zomboid

Project Zomboid

[B42/B41] Bandits NPC (v2)
[BUG] duplicate weapons on bandits
Replication:
b42, all mods disabled except Bandits, debug mode
Spawn bandits with firearms (in this test, wave 1 with 100% pistol chance and 50% rifle chance, and wave 15)
Some bandits, not all, will have duplicate weapons

In these screenshots you'll see the results
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=3411246894
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=3411246670
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=3411246289
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=3411246471

In the last 2 screenshots you can see the 2 handguns owned by the shell suited civilian, one in hand and one on belt; these are then both available to loot

Sometimes weapons are damaged but if there is a duplicate it will be in 100% condition






In further testing, commenting out the line

zombie:addItemToSpawnAtDeath(gun)

in bandit.lua results in no weapon spawning most of the time, but sometimes the weapon will still appear (100% condition) - i speculate that this is the duplicate, being created through another process
Last edited by 9kgsofrice; 20 Jan @ 6:54am