Skip to content

Commit 7acf989

Browse files
committed
Fix a typo in TextDrawCreate 'RPC' call. Handle null textdraws in TextDrawProperty changed (client).
1 parent afa3b8d commit 7acf989

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

amx/client/client.lua

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1195,6 +1195,16 @@ function TextDrawHideForPlayer(id)
11951195
end
11961196

11971197
function TextDrawPropertyChanged(id, prop, newval, skipInit)
1198+
if g_TextDraws == nil then
1199+
outputConsole('Error: g_TextDraws is nil')
1200+
return
1201+
end
1202+
1203+
if g_TextDraws[id] == nil then
1204+
outputConsole('Error: g_TextDraws is nil at index: ' .. id)
1205+
return
1206+
end
1207+
11981208
local textdraw = g_TextDraws[id]
11991209
textdraw[prop] = newval
12001210
if prop == 'boxsize' then
@@ -1209,8 +1219,8 @@ function TextDrawPropertyChanged(id, prop, newval, skipInit)
12091219
end
12101220

12111221
function TextDrawShowForPlayer(id)
1212-
outputConsole(string.format("TextDrawShowForPlayer trying to show textdraw with id %d", id))
1213-
outputConsole(string.format("TextDrawShowForPlayer trying to show textdraw with text %s", g_TextDraws[id].text))
1222+
--outputConsole(string.format("TextDrawShowForPlayer trying to show textdraw with id %d", id))
1223+
--outputConsole(string.format("TextDrawShowForPlayer trying to show textdraw with text %s", g_TextDraws[id].text))
12141224

12151225
showTextDraw(g_TextDraws[id])
12161226
end

amx/server/syscalls.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1669,7 +1669,7 @@ function CreatePlayerTextDraw(amx, player, x, y, text)
16691669
)
16701670

16711671
outputDebugString('assigned id s->' .. serverTDId .. ' c->' .. clientTDId .. ' to g_PlayerTextDraws[player]')
1672-
clientCall(player, 'TextDrawCreate', amx.name, clientTDId, table.deshadowize(textdraw, true))
1672+
clientCall(player, 'TextDrawCreate', clientTDId, table.deshadowize(textdraw, true))
16731673
return serverTDId
16741674
end
16751675
function PlayerTextDrawAlignment(amx, player, textdrawID, align)

0 commit comments

Comments
 (0)