Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(shop): Error messages tried to print player userdata #1704

Merged
merged 1 commit into from
Jan 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ All notable changes to TTT2 will be documented here. Inspired by [keep a changel
- Fixed an error when trying to pickup a placed equipment (e.g. beacon) (by @Histalek)
- Fixed corpse searching sound playing when searched by a spectator, searched covertly, or searched long range (by @TW1STaL1CKY)
- Fixed the mute button in the scoreboard not working (by @TW1STaL1CKY)
- Fixed a few errors in shop error messages (by @Histalek)

### Changed

Expand Down
8 changes: 4 additions & 4 deletions gamemodes/terrortown/gamemode/server/sv_shop.lua
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ local function HandleErrorMessage(ply, equipmentName, statusCode)
elseif statusCode == shop.statusCode.PENDINGORDER then
LANG.Msg(ply, "buy_pending", nil, MSG_MSTACK_ROLE)
elseif statusCode == shop.statusCode.NOTEXISTING then
Dev(1, ply .. " tried to buy equip that doesn't exist: " .. equipmentName)
Dev(1, ply:Nick() .. " tried to buy equip that doesn't exist: " .. equipmentName)
elseif statusCode == shop.statusCode.NOTENOUGHCREDITS then
Dev(1, ply .. " tried to buy item/weapon, but didn't have enough credits.")
Dev(1, ply:Nick() .. " tried to buy item/weapon, but didn't have enough credits.")
elseif statusCode == shop.statusCode.INVALIDID then
ErrorNoHaltWithStack("[TTT2][ERROR] No ID was requested by:", ply)
ErrorNoHaltWithStack("[TTT2][ERROR] Equipment without ID was requested by:", ply:Nick())
elseif statusCode == shop.statusCode.NOTBUYABLE then
LANG.Msg(ply, "This equipment cannot be bought.", nil, MSG_MSTACK_ROLE)
elseif statusCode == shop.statusCode.NOTENOUGHPLAYERS then
Expand Down Expand Up @@ -160,7 +160,7 @@ local function ConCommandOrderEquipment(ply, cmd, args)
local isSuccess, statusCode = shop.BuyEquipment(ply, args[1])

if not isSuccess then
HandleErrorMessage(ply, statusCode)
HandleErrorMessage(ply, args[1], statusCode)
end
end
concommand.Add("ttt_order_equipment", ConCommandOrderEquipment)
Expand Down
Loading