Skip to content

Commit

Permalink
[luadefs-server] Clean up ColShapes
Browse files Browse the repository at this point in the history
  • Loading branch information
qaisjp committed Sep 12, 2015
1 parent c41f39a commit 57544b4
Show file tree
Hide file tree
Showing 10 changed files with 339 additions and 324 deletions.
2 changes: 1 addition & 1 deletion MTA10_Server/mods/deathmatch/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,6 @@ LOGIC = \
./logic/lua/CLuaFunctionDefs.Account.cpp \
./logic/lua/CLuaFunctionDefs.Ban.cpp \
./logic/lua/CLuaFunctionDefs.Clothing.cpp \
./logic/lua/CLuaFunctionDefs.ColShape.cpp \
./logic/lua/CLuaFunctionDefs.Crypt.cpp \
./logic/lua/CLuaFunctionDefs.Database.cpp \
./logic/lua/CLuaFunctionDefs.Event.cpp \
Expand Down Expand Up @@ -222,6 +221,7 @@ LOGIC = \
./logic/luadefs/CLuaBlipDefs.cpp \
./logic/luadefs/CLuaCameraDefs.cpp \
./logic/luadefs/CLuaClassDefs.cpp \
./logic/luadefs/CLuaColShapeDefs.cpp \
./logic/luadefs/CLuaDefs.cpp \
./logic/luadefs/CLuaElementDefs.cpp \
./logic/luadefs/CLuaFileDefs.cpp \
Expand Down
1 change: 1 addition & 0 deletions MTA10_Server/mods/deathmatch/StdInc.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ struct SAclRequest;
#include "luadefs/CLuaBitDefs.h"
#include "luadefs/CLuaBlipDefs.h"
#include "luadefs/CLuaCameraDefs.h"
#include "luadefs/CLuaColShapeDefs.h"
#include "luadefs/CLuaDefs.h"
#include "luadefs/CLuaFileDefs.h"
#include "luadefs/CLuaHTTPDefs.h"
Expand Down
3 changes: 2 additions & 1 deletion MTA10_Server/mods/deathmatch/_ServerDeathmatch 2008.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,7 @@
<ClCompile Include="..\..\sdk\MTAPlatform.cpp" />
<ClCompile Include="logic\CPerfStat.PlayerPacketUsage.cpp" />
<ClCompile Include="logic\luadefs\CLuaBlipDefs.cpp" />
<ClCompile Include="logic\luadefs\CLuaColShapeDefs.cpp" />
<ClCompile Include="logic\luadefs\CLuaMarkerDefs.cpp" />
<ClCompile Include="logic\luadefs\CLuaMatrixDefs.cpp" />
<ClCompile Include="logic\luadefs\CLuaObjectDefs.cpp" />
Expand All @@ -467,7 +468,6 @@
<ClCompile Include="logic\lua\CLuaFunctionDefs.Account.cpp" />
<ClCompile Include="logic\lua\CLuaFunctionDefs.Ban.cpp" />
<ClCompile Include="logic\lua\CLuaFunctionDefs.Clothing.cpp" />
<ClCompile Include="logic\lua\CLuaFunctionDefs.ColShape.cpp" />
<ClCompile Include="logic\lua\CLuaFunctionDefs.Crypt.cpp" />
<ClCompile Include="logic\lua\CLuaFunctionDefs.Database.cpp" />
<ClCompile Include="logic\lua\CLuaFunctionDefs.Event.cpp" />
Expand Down Expand Up @@ -880,6 +880,7 @@
<ClInclude Include="..\..\..\vendor\zip\crypt.h" />
<ClInclude Include="CServer.h" />
<ClInclude Include="logic\luadefs\CLuaBlipDefs.h" />
<ClInclude Include="logic\luadefs\CLuaColShapeDefs.h" />
<ClInclude Include="logic\luadefs\CLuaMarkerDefs.h" />
<ClInclude Include="logic\luadefs\CLuaMatrixDefs.h" />
<ClInclude Include="logic\luadefs\CLuaObjectDefs.h" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -933,9 +933,6 @@
<ClCompile Include="logic\lua\CLuaFunctionDefs.Weapon.cpp">
<Filter>Source Files\logic\lua</Filter>
</ClCompile>
<ClCompile Include="logic\lua\CLuaFunctionDefs.ColShape.cpp">
<Filter>Source Files\logic\lua</Filter>
</ClCompile>
<ClCompile Include="logic\lua\CLuaFunctionDefs.UTF.cpp">
<Filter>Source Files\logic\lua</Filter>
</ClCompile>
Expand Down Expand Up @@ -990,6 +987,9 @@
<ClCompile Include="logic\luadefs\CLuaRadarAreaDefs.cpp">
<Filter>Source Files\logic\luadefs</Filter>
</ClCompile>
<ClCompile Include="logic\luadefs\CLuaColShapeDefs.cpp">
<Filter>Source Files\logic\lua</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="logic\CLightsyncManager.h">
Expand Down Expand Up @@ -1883,6 +1883,9 @@
<ClInclude Include="logic\luadefs\CLuaRadarAreaDefs.h">
<Filter>Header Files\logic\luadefs</Filter>
</ClInclude>
<ClInclude Include="logic\luadefs\CLuaColShapeDefs.h">
<Filter>Header Files\logic\luadefs</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<Xml Include="acl.xml">
Expand Down
8 changes: 0 additions & 8 deletions MTA10_Server/mods/deathmatch/logic/lua/CLuaFunctionDefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,6 @@ class CLuaFunctionDefs
LUA_DECLARE ( GetTypeIndexFromClothes );
LUA_DECLARE ( GetClothesTypeName );

// Shape create funcs
LUA_DECLARE ( CreateColCircle );
LUA_DECLARE ( CreateColCuboid );
LUA_DECLARE ( CreateColSphere );
LUA_DECLARE ( CreateColRectangle );
LUA_DECLARE ( CreateColPolygon );
LUA_DECLARE ( CreateColTube );

// Weapon funcs
LUA_DECLARE ( GetWeaponProperty );
LUA_DECLARE ( GetOriginalWeaponProperty );
Expand Down
18 changes: 1 addition & 17 deletions MTA10_Server/mods/deathmatch/logic/lua/CLuaMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -233,22 +233,6 @@ void CLuaMain::AddBanClass ( lua_State* luaVM )
}


void CLuaMain::AddColShapeClass ( lua_State* luaVM )
{
lua_newclass ( luaVM );

lua_classfunction ( luaVM, "Circle", "createColCircle" );
lua_classfunction ( luaVM, "Cuboid", "createColCuboid" );
lua_classfunction ( luaVM, "Rectangle", "createColRectangle" );
lua_classfunction ( luaVM, "Sphere", "createColSphere" );
lua_classfunction ( luaVM, "Tube", "createColTube" );
lua_classfunction ( luaVM, "Polygon", "createColPolygon" );

lua_classfunction ( luaVM, "getElementsWithin", "getElementsWithinColShape" );
lua_registerclass ( luaVM, "ColShape", "Element" );
}


void CLuaMain::AddConnectionClass ( lua_State* luaVM )
{
lua_newclass ( luaVM );
Expand Down Expand Up @@ -293,6 +277,7 @@ void CLuaMain::InitClasses ( lua_State* luaVM )
// Putting CLuaElementDefs::AddClass near
// the bottom will cause a crash.
CLuaElementDefs ::AddClass ( luaVM );
CLuaColShapeDefs ::AddClass ( luaVM );
CLuaFileDefs ::AddClass ( luaVM );
CLuaXMLDefs ::AddClass ( luaVM );
CLuaPickupDefs ::AddClass ( luaVM );
Expand All @@ -311,7 +296,6 @@ void CLuaMain::InitClasses ( lua_State* luaVM )
CLuaRadarAreaDefs ::AddClass ( luaVM );
AddAccountClass ( luaVM );
AddBanClass ( luaVM );
AddColShapeClass ( luaVM );
AddConnectionClass ( luaVM );
AddQueryHandleClass ( luaVM );
}
Expand Down
1 change: 0 additions & 1 deletion MTA10_Server/mods/deathmatch/logic/lua/CLuaMain.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ class CLuaMain //: public CClient
public:
void AddAccountClass ( lua_State* luaVM );
void AddBanClass ( lua_State* luaVM );
void AddColShapeClass ( lua_State* luaVM );
void AddConnectionClass ( lua_State* luaVM );
void AddQueryHandleClass ( lua_State* luaVM );

Expand Down
9 changes: 1 addition & 8 deletions MTA10_Server/mods/deathmatch/logic/lua/CLuaManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,14 +202,6 @@ void CLuaManager::LoadCFunctions ( void )
CLuaCFunctions::AddFunction ( "getTypeIndexFromClothes", CLuaFunctionDefs::GetTypeIndexFromClothes );
CLuaCFunctions::AddFunction ( "getClothesTypeName", CLuaFunctionDefs::GetClothesTypeName );

// Shape create funcs
CLuaCFunctions::AddFunction ( "createColCircle", CLuaFunctionDefs::CreateColCircle );
CLuaCFunctions::AddFunction ( "createColCuboid", CLuaFunctionDefs::CreateColCuboid );
CLuaCFunctions::AddFunction ( "createColSphere", CLuaFunctionDefs::CreateColSphere );
CLuaCFunctions::AddFunction ( "createColRectangle", CLuaFunctionDefs::CreateColRectangle );
CLuaCFunctions::AddFunction ( "createColPolygon", CLuaFunctionDefs::CreateColPolygon );
CLuaCFunctions::AddFunction ( "createColTube", CLuaFunctionDefs::CreateColTube );

// Weapon funcs
CLuaCFunctions::AddFunction ( "getWeaponNameFromID", CLuaFunctionDefs::GetWeaponNameFromID );
CLuaCFunctions::AddFunction ( "getWeaponIDFromName", CLuaFunctionDefs::GetWeaponIDFromName );
Expand Down Expand Up @@ -317,6 +309,7 @@ void CLuaManager::LoadCFunctions ( void )
CLuaWaterDefs::LoadFunctions ();
CLuaTimerDefs::LoadFunctions ();
CLuaRadarAreaDefs::LoadFunctions ();
CLuaColShapeDefs::LoadFunctions ();

// All-Seeing Eye Functions
CLuaCFunctions::AddFunction ( "getGameType", CLuaFunctionDefs::GetGameType );
Expand Down

0 comments on commit 57544b4

Please sign in to comment.