diff --git a/changelog.md b/changelog.md index 831ad202..11b10ce8 100644 --- a/changelog.md +++ b/changelog.md @@ -19,6 +19,7 @@ - Fixed: Level transition can carry some unwanted entities to the next map. - Fixed: d2_coast_08: Incorrect player spawn when directly starting from this map. - Fixed: Compatibility with addons that use GM:AddDeathNotice, this caused errors to appear. +- Fixed: Weapons from players respawning when picked up. 0.9.27 - Fixed: Entity inputs/outputs are parsed incorrect. diff --git a/gamemode/sv_player_pickup.lua b/gamemode/sv_player_pickup.lua index b2ad1d88..67958bf0 100644 --- a/gamemode/sv_player_pickup.lua +++ b/gamemode/sv_player_pickup.lua @@ -197,7 +197,7 @@ function GM:PlayerCanPickupItem(ply, item) DbgPrintPickup("PlayerCanPickupItem", ply, item) if item.CreatedForPlayer ~= nil then - if item.CreatedForPlayer == ply then + if item.CreatedForPlayer == ply or item.CreatedForPlayer == NULL then DbgPrintPickup("Simple pickup, created for player: " .. tostring(ply)) return true @@ -252,7 +252,7 @@ function GM:PlayerCanPickupWeapon(ply, wep) end if wep.CreatedForPlayer ~= nil then - if wep.CreatedForPlayer == ply then + if wep.CreatedForPlayer == ply or wep.CreatedForPlayer == NULL then DbgPrintPickup(ply, "Simple pickup, created for player") return true @@ -311,7 +311,7 @@ function GM:WeaponEquip(wep, owner) end end - if wep.CreatedForPlayer ~= owner and wep.DroppedByPlayer == nil then + if wep.CreatedForPlayer == nil and wep.DroppedByPlayer == nil then if AMMO_LIKE_WEAPONS[wep:GetClass()] ~= true and self:CallGameTypeFunc("ShouldRespawnWeapon", wep) == true then local respawnTime = self:CallGameTypeFunc("GetWeaponRespawnTime") or 0.5 @@ -321,5 +321,5 @@ function GM:WeaponEquip(wep, owner) end end - wep.CreatedForPlayer = nil + wep.CreatedForPlayer = NULL end \ No newline at end of file