Skip to content

Commit 367ec74

Browse files
author
Marek Kulik
committed
Rename function to LogWarningIfPlayerHasNotJoinedYet
1 parent 7dea70c commit 367ec74

File tree

5 files changed

+68
-68
lines changed

5 files changed

+68
-68
lines changed

Server/mods/deathmatch/logic/luadefs/CLuaDefs.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -253,15 +253,15 @@ void CLuaDefs::DidUseFunction ( lua_CFunction f, lua_State* luaVM )
253253
//
254254
// Prints a warning message in script-debug if the element is a player and not joined yet
255255
//
256-
void CLuaDefs::VerifyPlayerIsJoinedUsage ( lua_State* luaVM, CElement* pElement )
256+
void CLuaDefs::LogWarningIfPlayerHasNotJoinedYet ( lua_State* luaVM, CElement* pElement )
257257
{
258-
static auto szNotjoinedPlayerUsageWarning = "Modifying players before onPlayerJoin can cause desynchronization";
258+
static auto szWarningText = "Modifying players before onPlayerJoin can cause desynchronization";
259259

260260
if ( pElement && IS_PLAYER ( pElement ) )
261261
{
262262
auto pPlayer = static_cast < CPlayer * > ( pElement );
263263

264264
if ( !pPlayer->IsJoined() )
265-
m_pScriptDebugging->LogWarning ( luaVM, "%s: %s", lua_tostring ( luaVM, lua_upvalueindex ( 1 ) ), szNotjoinedPlayerUsageWarning );
265+
m_pScriptDebugging->LogWarning ( luaVM, "%s: %s", lua_tostring ( luaVM, lua_upvalueindex ( 1 ) ), szWarningText );
266266
}
267267
}

Server/mods/deathmatch/logic/luadefs/CLuaDefs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class CLuaDefs
6363
static bool CanUseFunction ( const char* szFunction, lua_State* luaVM, bool bRestricted );
6464
static int CanUseFunction ( lua_CFunction f, lua_State* luaVM );
6565
static void DidUseFunction ( lua_CFunction f, lua_State* luaVM );
66-
static void VerifyPlayerIsJoinedUsage ( lua_State* luaVM, CElement* pElement );
66+
static void LogWarningIfPlayerHasNotJoinedYet ( lua_State* luaVM, CElement* pElement );
6767

6868
// This is just for the Lua funcs. Please don't public this and use it other
6969
// places in the server.

Server/mods/deathmatch/logic/luadefs/CLuaElementDefs.cpp

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1157,7 +1157,7 @@ int CLuaElementDefs::setElementAttachedOffsets ( lua_State* luaVM )
11571157

11581158
if ( !argStream.HasErrors () )
11591159
{
1160-
VerifyPlayerIsJoinedUsage ( luaVM, pElement );
1160+
LogWarningIfPlayerHasNotJoinedYet ( luaVM, pElement );
11611161

11621162
if ( CStaticFunctionDefinitions::SetElementAttachedOffsets ( pElement, vecPosition, vecRotation ) )
11631163
{
@@ -1496,7 +1496,7 @@ int CLuaElementDefs::setElementID ( lua_State* luaVM )
14961496

14971497
if ( !argStream.HasErrors () )
14981498
{
1499-
VerifyPlayerIsJoinedUsage ( luaVM, pElement );
1499+
LogWarningIfPlayerHasNotJoinedYet ( luaVM, pElement );
15001500

15011501
if ( CStaticFunctionDefinitions::SetElementID ( pElement, strId ) )
15021502
{
@@ -1528,7 +1528,7 @@ int CLuaElementDefs::setElementData ( lua_State* luaVM )
15281528
CLuaMain* pLuaMain = m_pLuaManager->GetVirtualMachine ( luaVM );
15291529
if ( pLuaMain )
15301530
{
1531-
VerifyPlayerIsJoinedUsage ( luaVM, pElement );
1531+
LogWarningIfPlayerHasNotJoinedYet ( luaVM, pElement );
15321532

15331533
if ( strKey.length () > MAX_CUSTOMDATA_NAME_LENGTH )
15341534
{
@@ -1566,7 +1566,7 @@ int CLuaElementDefs::removeElementData ( lua_State* luaVM )
15661566
CLuaMain* pLuaMain = m_pLuaManager->GetVirtualMachine ( luaVM );
15671567
if ( pLuaMain )
15681568
{
1569-
VerifyPlayerIsJoinedUsage ( luaVM, pElement );
1569+
LogWarningIfPlayerHasNotJoinedYet ( luaVM, pElement );
15701570

15711571
if ( strKey.length () > MAX_CUSTOMDATA_NAME_LENGTH )
15721572
{
@@ -1613,7 +1613,7 @@ int CLuaElementDefs::setElementMatrix ( lua_State* luaVM )
16131613
// Verify the arguments
16141614
if ( !argStream.HasErrors ( ) )
16151615
{
1616-
VerifyPlayerIsJoinedUsage ( luaVM, pElement );
1616+
LogWarningIfPlayerHasNotJoinedYet ( luaVM, pElement );
16171617

16181618
if ( CStaticFunctionDefinitions::SetElementMatrix ( pElement, matrix ) )
16191619
{
@@ -1641,7 +1641,7 @@ int CLuaElementDefs::setElementParent ( lua_State* luaVM )
16411641

16421642
if ( !argStream.HasErrors () )
16431643
{
1644-
VerifyPlayerIsJoinedUsage ( luaVM, pElement );
1644+
LogWarningIfPlayerHasNotJoinedYet ( luaVM, pElement );
16451645

16461646
if ( CStaticFunctionDefinitions::SetElementParent ( pElement, pParent ) )
16471647
{
@@ -1681,7 +1681,7 @@ int CLuaElementDefs::setElementPosition ( lua_State* luaVM )
16811681

16821682
if ( !argStream.HasErrors () )
16831683
{
1684-
VerifyPlayerIsJoinedUsage ( luaVM, pElement );
1684+
LogWarningIfPlayerHasNotJoinedYet ( luaVM, pElement );
16851685

16861686
// Set the position
16871687
if ( CStaticFunctionDefinitions::SetElementPosition ( pElement, vecPosition, bWarp ) )
@@ -1711,7 +1711,7 @@ int CLuaElementDefs::setElementRotation ( lua_State* luaVM )
17111711

17121712
if ( !argStream.HasErrors () )
17131713
{
1714-
VerifyPlayerIsJoinedUsage ( luaVM, pElement );
1714+
LogWarningIfPlayerHasNotJoinedYet ( luaVM, pElement );
17151715

17161716
// Set the rotation
17171717
if ( CStaticFunctionDefinitions::SetElementRotation ( pElement, vecRotation, rotationOrder, bNewWay ) )
@@ -1740,7 +1740,7 @@ int CLuaElementDefs::OOP_setElementRotation ( lua_State* luaVM )
17401740

17411741
if ( !argStream.HasErrors () )
17421742
{
1743-
VerifyPlayerIsJoinedUsage ( luaVM, pElement );
1743+
LogWarningIfPlayerHasNotJoinedYet ( luaVM, pElement );
17441744

17451745
CMatrix matrix;
17461746

@@ -1791,7 +1791,7 @@ int CLuaElementDefs::setElementVelocity ( lua_State* luaVM )
17911791

17921792
if ( !argStream.HasErrors () )
17931793
{
1794-
VerifyPlayerIsJoinedUsage ( luaVM, pElement );
1794+
LogWarningIfPlayerHasNotJoinedYet ( luaVM, pElement );
17951795

17961796
// Set the velocity
17971797
if ( CStaticFunctionDefinitions::SetElementVelocity ( pElement, vecVelocity ) )
@@ -1820,7 +1820,7 @@ int CLuaElementDefs::setElementVisibleTo ( lua_State* luaVM )
18201820

18211821
if ( !argStream.HasErrors () )
18221822
{
1823-
VerifyPlayerIsJoinedUsage ( luaVM, pElement );
1823+
LogWarningIfPlayerHasNotJoinedYet ( luaVM, pElement );
18241824

18251825
if ( CStaticFunctionDefinitions::SetElementVisibleTo ( pElement, pReference, bVisible ) )
18261826
{
@@ -1849,7 +1849,7 @@ int CLuaElementDefs::setElementInterior ( lua_State* luaVM )
18491849

18501850
if ( !argStream.HasErrors () )
18511851
{
1852-
VerifyPlayerIsJoinedUsage ( luaVM, pElement );
1852+
LogWarningIfPlayerHasNotJoinedYet ( luaVM, pElement );
18531853

18541854
unsigned char ucInterior = static_cast < unsigned char > ( uiInterior );
18551855
if ( CStaticFunctionDefinitions::SetElementInterior ( pElement, ucInterior, bSetPosition, vecPosition ) )
@@ -1890,7 +1890,7 @@ int CLuaElementDefs::setElementDimension ( lua_State* luaVM )
18901890

18911891
if ( !argStream.HasErrors () )
18921892
{
1893-
VerifyPlayerIsJoinedUsage ( luaVM, pElement );
1893+
LogWarningIfPlayerHasNotJoinedYet ( luaVM, pElement );
18941894

18951895
if ( bMakeVisibleInAllDimensions )
18961896
{
@@ -1944,7 +1944,7 @@ int CLuaElementDefs::attachElements ( lua_State* luaVM )
19441944

19451945
if ( !argStream.HasErrors () )
19461946
{
1947-
VerifyPlayerIsJoinedUsage ( luaVM, pElement );
1947+
LogWarningIfPlayerHasNotJoinedYet ( luaVM, pElement );
19481948

19491949
if ( CStaticFunctionDefinitions::AttachElements ( pElement, pAttachedToElement, vecPosition, vecRotation ) )
19501950
{
@@ -1971,7 +1971,7 @@ int CLuaElementDefs::detachElements ( lua_State* luaVM )
19711971

19721972
if ( !argStream.HasErrors () )
19731973
{
1974-
VerifyPlayerIsJoinedUsage ( luaVM, pElement );
1974+
LogWarningIfPlayerHasNotJoinedYet ( luaVM, pElement );
19751975

19761976
if ( CStaticFunctionDefinitions::DetachElements ( pElement, pAttachedToElement ) )
19771977
{
@@ -1998,7 +1998,7 @@ int CLuaElementDefs::setElementAlpha ( lua_State* luaVM )
19981998

19991999
if ( !argStream.HasErrors () )
20002000
{
2001-
VerifyPlayerIsJoinedUsage ( luaVM, pElement );
2001+
LogWarningIfPlayerHasNotJoinedYet ( luaVM, pElement );
20022002

20032003
if ( CStaticFunctionDefinitions::SetElementAlpha ( pElement, ucAlpha ) )
20042004
{
@@ -2050,7 +2050,7 @@ int CLuaElementDefs::setElementHealth ( lua_State* luaVM )
20502050

20512051
if ( !argStream.HasErrors() )
20522052
{
2053-
VerifyPlayerIsJoinedUsage ( luaVM, pElement );
2053+
LogWarningIfPlayerHasNotJoinedYet ( luaVM, pElement );
20542054

20552055
if ( CStaticFunctionDefinitions::SetElementHealth ( pElement, fHealth ) )
20562056
{
@@ -2077,7 +2077,7 @@ int CLuaElementDefs::setElementModel ( lua_State* luaVM )
20772077

20782078
if ( !argStream.HasErrors () )
20792079
{
2080-
VerifyPlayerIsJoinedUsage ( luaVM, pElement );
2080+
LogWarningIfPlayerHasNotJoinedYet ( luaVM, pElement );
20812081

20822082
if ( CStaticFunctionDefinitions::SetElementModel ( pElement, usModel ) )
20832083
{
@@ -2130,7 +2130,7 @@ int CLuaElementDefs::setElementCollisionsEnabled ( lua_State* luaVM )
21302130

21312131
if ( !argStream.HasErrors () )
21322132
{
2133-
VerifyPlayerIsJoinedUsage ( luaVM, pElement );
2133+
LogWarningIfPlayerHasNotJoinedYet ( luaVM, pElement );
21342134

21352135
if ( CStaticFunctionDefinitions::SetElementCollisionsEnabled ( pElement, bEnable ) )
21362136
{
@@ -2157,7 +2157,7 @@ int CLuaElementDefs::setElementFrozen ( lua_State* luaVM )
21572157

21582158
if ( !argStream.HasErrors () )
21592159
{
2160-
VerifyPlayerIsJoinedUsage ( luaVM, pElement );
2160+
LogWarningIfPlayerHasNotJoinedYet ( luaVM, pElement );
21612161

21622162
if ( CStaticFunctionDefinitions::SetElementFrozen ( pElement, bFrozen ) )
21632163
{
@@ -2259,7 +2259,7 @@ int CLuaElementDefs::setElementCallPropagationEnabled ( lua_State* luaVM )
22592259

22602260
if ( !argStream.HasErrors () )
22612261
{
2262-
VerifyPlayerIsJoinedUsage ( luaVM, pEntity );
2262+
LogWarningIfPlayerHasNotJoinedYet ( luaVM, pEntity );
22632263

22642264
if ( CStaticFunctionDefinitions::SetElementCallPropagationEnabled ( pEntity, bEnable ) )
22652265
{

0 commit comments

Comments
 (0)