Skip to content

Commit 27bbeac

Browse files
committed
Fix file formatting in #187
1 parent 89e5727 commit 27bbeac

File tree

4 files changed

+42
-40
lines changed

4 files changed

+42
-40
lines changed

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

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -35,57 +35,57 @@ void CLuaColShapeDefs::AddClass(lua_State* luaVM)
3535

3636
lua_classfunction(luaVM, "getElementsWithin", "getElementsWithinColShape");
3737
lua_classvariable(luaVM, "elementsWithin", NULL, "getElementsWithinColShape");
38-
38+
3939
lua_classvariable(luaVM, "elementsWithin", NULL, "getElementsWithinColShape");
4040
lua_classvariable(luaVM, "shapeType", NULL, "getColShapeType");
4141

4242
lua_registerclass(luaVM, "ColShape", "Element");
4343
}
4444

45-
int CLuaColShapeDefs::GetColShapeType ( lua_State* luaVM )
45+
int CLuaColShapeDefs::GetColShapeType(lua_State* luaVM)
4646
{
4747
// Verify the arguments
4848
CClientColShape* pColShape = nullptr;
49-
CScriptArgReader argStream ( luaVM );
50-
argStream.ReadUserData ( pColShape );
49+
CScriptArgReader argStream(luaVM);
50+
argStream.ReadUserData(pColShape);
5151

52-
if ( !argStream.HasErrors ( ) )
52+
if (!argStream.HasErrors())
5353
{
5454
// Grab our VM
55-
CLuaMain* pLuaMain = m_pLuaManager->GetVirtualMachine ( luaVM );
55+
CLuaMain* pLuaMain = m_pLuaManager->GetVirtualMachine(luaVM);
5656
if (pLuaMain)
5757
{
58-
switch ( pColShape->GetShapeType( ) )
58+
switch (pColShape->GetShapeType())
5959
{
60-
case 0:
61-
lua_pushstring(luaVM, "Circle");
62-
break;
63-
case 1:
64-
lua_pushstring(luaVM, "Cuboid");
65-
break;
66-
case 2:
67-
lua_pushstring(luaVM, "Sphere");
68-
break;
69-
case 3:
70-
lua_pushstring(luaVM, "Rectangle");
71-
break;
72-
case 4:
73-
lua_pushstring(luaVM, "Polygon");
74-
break;
75-
case 5:
76-
lua_pushstring(luaVM, "Tube");
77-
break;
78-
default:
79-
lua_pushboolean(luaVM, false);
60+
case 0:
61+
lua_pushstring(luaVM, "Circle");
62+
break;
63+
case 1:
64+
lua_pushstring(luaVM, "Cuboid");
65+
break;
66+
case 2:
67+
lua_pushstring(luaVM, "Sphere");
68+
break;
69+
case 3:
70+
lua_pushstring(luaVM, "Rectangle");
71+
break;
72+
case 4:
73+
lua_pushstring(luaVM, "Polygon");
74+
break;
75+
case 5:
76+
lua_pushstring(luaVM, "Tube");
77+
break;
78+
default:
79+
lua_pushboolean(luaVM, false);
8080
}
8181
return 1;
8282
}
8383
}
8484
else
85-
m_pScriptDebugging->LogCustom ( luaVM, argStream.GetFullErrorMessage ( ) );
85+
m_pScriptDebugging->LogCustom(luaVM, argStream.GetFullErrorMessage());
8686

8787
// Failed
88-
lua_pushboolean ( luaVM, false );
88+
lua_pushboolean(luaVM, false);
8989
return 1;
9090
}
9191

Client/mods/deathmatch/logic/luadefs/CLuaColShapeDefs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@ class CLuaColShapeDefs : public CLuaDefs
2424
LUA_DECLARE(CreateColRectangle);
2525
LUA_DECLARE(CreateColPolygon);
2626
LUA_DECLARE(CreateColTube);
27-
27+
2828
LUA_DECLARE(GetColShapeType);
2929
};

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

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,31 +38,32 @@ void CLuaColShapeDefs::AddClass(lua_State* luaVM)
3838
lua_classfunction(luaVM, "getShapeType", "getColShapeType");
3939

4040
lua_classvariable(luaVM, "shapeType", nullptr, "getColShapeType");
41+
4142
lua_registerclass(luaVM, "ColShape", "Element");
4243
}
4344

44-
int CLuaColShapeDefs::GetColShapeType ( lua_State* luaVM )
45+
int CLuaColShapeDefs::GetColShapeType(lua_State* luaVM)
4546
{
4647
// Verify the arguments
47-
CColShape* pColShape = nullptr;
48-
CScriptArgReader argStream ( luaVM );
49-
argStream.ReadUserData( pColShape );
48+
CColShape* pColShape = nullptr;
49+
CScriptArgReader argStream(luaVM);
50+
argStream.ReadUserData(pColShape);
5051

51-
if ( !argStream.HasErrors( ) )
52+
if (!argStream.HasErrors())
5253
{
5354
// Grab our VM
54-
CLuaMain* pLuaMain = m_pLuaManager->GetVirtualMachine ( luaVM );
55+
CLuaMain* pLuaMain = m_pLuaManager->GetVirtualMachine(luaVM);
5556
if (pLuaMain)
5657
{
57-
lua_pushnumber ( luaVM, pColShape->GetShapeType ( ) + 1); // start from 1 not 0
58+
lua_pushnumber(luaVM, pColShape->GetShapeType() + 1); // start from 1 not 0
5859
return 1;
5960
}
6061
}
6162
else
62-
m_pScriptDebugging->LogCustom ( luaVM, argStream.GetFullErrorMessage ( ) );
63+
m_pScriptDebugging->LogCustom(luaVM, argStream.GetFullErrorMessage());
6364

6465
// Failed
65-
lua_pushboolean ( luaVM, false );
66+
lua_pushboolean(luaVM, false);
6667
return 1;
6768
}
6869

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,6 @@ class CLuaColShapeDefs : public CLuaDefs
2525
LUA_DECLARE(CreateColRectangle);
2626
LUA_DECLARE(CreateColPolygon);
2727
LUA_DECLARE(CreateColTube);
28+
2829
LUA_DECLARE(GetColShapeType);
29-
};
30+
};

0 commit comments

Comments
 (0)