Skip to content

Commit

Permalink
fix(server/player): use inverted state for canUseWeapons statebag (#537)
Browse files Browse the repository at this point in the history
Dead people shouldn't use weapons while living people can use weapons
  • Loading branch information
solareon authored Aug 14, 2024
1 parent 76f47ce commit 75fe6aa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server/player.lua
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,7 @@ function CreatePlayer(playerData, Offline)
Player(self.PlayerData.source).state:set(meta, val, true)
end
if (meta == 'dead' or meta == 'inlaststand') and self.PlayerData.source then
Player(self.PlayerData.source).state:set('canUseWeapons', val, true)
Player(self.PlayerData.source).state:set('canUseWeapons', not val, true)
end

local oldVal = self.PlayerData.metadata[meta]
Expand Down

0 comments on commit 75fe6aa

Please sign in to comment.