Skip to content

Commit 3739f84

Browse files
committed
CLuaBlipDefs: add a client-side warning for out of bounds size
1 parent 0fa3913 commit 3739f84

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Client/mods/deathmatch/logic/luadefs/CLuaBlipDefs.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@ int CLuaBlipDefs::CreateBlip(lua_State* luaVM)
8080
argStream.SetCustomError("Invalid icon");
8181
}
8282

83+
if (iSize < 0 || iSize > 25)
84+
argStream.SetCustomWarning(SString("Blip size beyond 25 is no longer supported (got %i). It will be clamped between 0 and 25.", iSize));
85+
8386
if (!argStream.HasErrors())
8487
{
8588
CLuaMain* pLuaMain = m_pLuaManager->GetVirtualMachine(luaVM);
@@ -141,6 +144,9 @@ int CLuaBlipDefs::CreateBlipAttachedTo(lua_State* luaVM)
141144
argStream.SetCustomError("Invalid icon");
142145
}
143146

147+
if (iSize < 0 || iSize > 25)
148+
argStream.SetCustomWarning(SString("Blip size beyond 25 is no longer supported (got %i). It will be clamped between 0 and 25.", iSize));
149+
144150
if (!argStream.HasErrors())
145151
{
146152
CLuaMain* pLuaMain = m_pLuaManager->GetVirtualMachine(luaVM);
@@ -310,6 +316,9 @@ int CLuaBlipDefs::SetBlipSize(lua_State* luaVM)
310316
argStream.ReadUserData(pEntity);
311317
argStream.ReadNumber(iSize);
312318

319+
if (iSize < 0 || iSize > 25)
320+
argStream.SetCustomWarning(SString("Blip size beyond 25 is no longer supported (got %i). It will be clamped between 0 and 25.", iSize));
321+
313322
if (!argStream.HasErrors())
314323
{
315324
unsigned char ucSize = Clamp(0, iSize, 25);

0 commit comments

Comments
 (0)