Skip to content

Commit 965ed20

Browse files
committed
Clean up client Team luadefs
(cherry picked from commit efcbb6b)
1 parent 2d0cf7c commit 965ed20

File tree

9 files changed

+250
-236
lines changed

9 files changed

+250
-236
lines changed

MTA10/mods/deathmatch/StdInc.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@
126126
#include <luadefs/CLuaMatrixDefs.h>
127127
#include <luadefs/CLuaSearchLightDefs.h>
128128
#include <luadefs/CLuaTaskDefs.h>
129+
#include <luadefs/CLuaTeamDefs.h>
129130
#include <luadefs/CLuaFxDefs.h>
130131
#include <luadefs/CLuaFileDefs.h>
131132
#include <lua/oopdefs/CLuaOOPDefs.h>

MTA10/mods/deathmatch/_Deathmatch 2008.vcxproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,7 @@
379379
<ClCompile Include="..\shared_logic\luadefs\CLuaRadarAreaDefs.cpp" />
380380
<ClCompile Include="..\shared_logic\luadefs\CLuaResourceDefs.cpp" />
381381
<ClCompile Include="..\shared_logic\luadefs\CLuaSearchLightDefs.cpp" />
382+
<ClCompile Include="..\shared_logic\luadefs\CLuaTeamDefs.cpp" />
382383
<ClCompile Include="..\shared_logic\luadefs\CLuaVector2Defs.cpp" />
383384
<ClCompile Include="..\shared_logic\luadefs\CLuaVector3Defs.cpp" />
384385
<ClCompile Include="..\shared_logic\luadefs\CLuaVector4Defs.cpp" />
@@ -581,7 +582,6 @@
581582
<ClCompile Include="..\shared_logic\lua\CLuaFunctionDefs.Pickup.cpp" />
582583
<ClCompile Include="..\shared_logic\lua\CLuaFunctionDefs.Projectile.cpp" />
583584
<ClCompile Include="..\shared_logic\lua\CLuaFunctionDefs.Shape.cpp" />
584-
<ClCompile Include="..\shared_logic\lua\CLuaFunctionDefs.Team.cpp" />
585585
<ClCompile Include="..\shared_logic\lua\CLuaFunctionDefs.Util.cpp" />
586586
<ClCompile Include="..\shared_logic\lua\CLuaFunctionDefs.Voice.cpp" />
587587
<ClCompile Include="..\shared_logic\lua\CLuaFunctionDefs.Weapon.cpp" />
@@ -770,6 +770,7 @@
770770
<ClInclude Include="..\shared_logic\luadefs\CLuaRadarAreaDefs.h" />
771771
<ClInclude Include="..\shared_logic\luadefs\CLuaResourceDefs.h" />
772772
<ClInclude Include="..\shared_logic\luadefs\CLuaSearchLightDefs.h" />
773+
<ClInclude Include="..\shared_logic\luadefs\CLuaTeamDefs.h" />
773774
<ClInclude Include="..\shared_logic\luadefs\CLuaVector2Defs.h" />
774775
<ClInclude Include="..\shared_logic\luadefs\CLuaVector3Defs.h" />
775776
<ClInclude Include="..\shared_logic\luadefs\CLuaVector4Defs.h" />

MTA10/mods/deathmatch/_Deathmatch 2008.vcxproj.filters

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -602,9 +602,6 @@
602602
<ClCompile Include="..\shared_logic\lua\CLuaFunctionDefs.Shape.cpp">
603603
<Filter>Source Files\shared_logic\lua</Filter>
604604
</ClCompile>
605-
<ClCompile Include="..\shared_logic\lua\CLuaFunctionDefs.Team.cpp">
606-
<Filter>Source Files\shared_logic\lua</Filter>
607-
</ClCompile>
608605
<ClCompile Include="..\shared_logic\lua\CLuaFunctionDefs.Util.cpp">
609606
<Filter>Source Files\shared_logic\lua</Filter>
610607
</ClCompile>
@@ -926,6 +923,9 @@
926923
<ClCompile Include="..\shared_logic\luadefs\CLuaResourceDefs.cpp">
927924
<Filter>Source Files\shared_logic\luadefs</Filter>
928925
</ClCompile>
926+
<ClCompile Include="..\shared_logic\luadefs\CLuaTeamDefs.cpp">
927+
<Filter>Source Files\shared_logic\luadefs</Filter>
928+
</ClCompile>
929929
</ItemGroup>
930930
<ItemGroup>
931931
<ClInclude Include="CClient.h">
@@ -1693,5 +1693,8 @@
16931693
<ClInclude Include="..\shared_logic\luadefs\CLuaResourceDefs.h">
16941694
<Filter>Header Files\shared_logic\luadefs</Filter>
16951695
</ClInclude>
1696+
<ClInclude Include="..\shared_logic\luadefs\CLuaTeamDefs.h">
1697+
<Filter>Header Files\shared_logic\luadefs</Filter>
1698+
</ClInclude>
16961699
</ItemGroup>
16971700
</Project>

MTA10/mods/shared_logic/lua/CLuaFunctionDefs.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -465,14 +465,6 @@ class CLuaFunctionDefs
465465
LUA_DECLARE ( CreateColPolygon );
466466
LUA_DECLARE ( CreateColTube );
467467

468-
// Team get funcs
469-
LUA_DECLARE ( GetTeamFromName );
470-
LUA_DECLARE ( GetTeamName );
471-
LUA_DECLARE ( GetTeamColor );
472-
LUA_DECLARE ( GetTeamFriendlyFire );
473-
LUA_DECLARE ( GetPlayersInTeam );
474-
LUA_DECLARE ( CountPlayersInTeam );
475-
476468
// Weapon funcs
477469
LUA_DECLARE ( GetWeaponNameFromID );
478470
LUA_DECLARE ( GetWeaponIDFromName );

MTA10/mods/shared_logic/lua/CLuaMain.cpp

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -196,28 +196,6 @@ void CLuaMain::AddProjectileClass ( lua_State* luaVM )
196196
lua_registerclass ( luaVM, "Projectile", "Element" );
197197
}
198198

199-
200-
// TODO: specials
201-
void CLuaMain::AddTeamClass ( lua_State* luaVM )
202-
{
203-
lua_newclass ( luaVM );
204-
205-
lua_classfunction ( luaVM, "create", "getTeamFromName" );
206-
lua_classfunction ( luaVM, "getFromName", "getTeamFromName" );
207-
lua_classfunction ( luaVM, "countPlayers", "countPlayersInTeam" );
208-
lua_classfunction ( luaVM, "getFriendlyFire", "getTeamFriendlyFire" );
209-
lua_classfunction ( luaVM, "getName", "getTeamName" );
210-
lua_classfunction ( luaVM, "getColor", "getTeamColor" );
211-
212-
lua_classvariable ( luaVM, "playerCount", NULL, "countPlayersInTeam" );
213-
lua_classvariable ( luaVM, "friendlyFire", NULL, "getTeamFriendlyFire" );
214-
lua_classvariable ( luaVM, "name", NULL, "getTeamName" );
215-
//lua_classvariable ( luaVM, "color", NULL, "getTeamColor" );
216-
217-
lua_registerclass ( luaVM, "Team", "Element" );
218-
}
219-
220-
221199
// TODO: specials
222200
void CLuaMain::AddWaterClass ( lua_State* luaVM )
223201
{
@@ -896,7 +874,6 @@ void CLuaMain::InitClasses ( lua_State* luaVM )
896874
AddColShapeClass ( luaVM );
897875
AddProjectileClass ( luaVM );
898876

899-
AddTeamClass ( luaVM );
900877
AddWaterClass ( luaVM );
901878
CLuaAudioDefs::AddClass ( luaVM );
902879
AddWeaponClass ( luaVM );
@@ -946,6 +923,7 @@ void CLuaMain::InitClasses ( lua_State* luaVM )
946923
CLuaRadarAreaDefs::AddClass ( luaVM );
947924
CLuaResourceDefs::AddClass ( luaVM );
948925
CLuaSearchLightDefs::AddClass ( luaVM );
926+
CLuaTeamDefs::AddClass ( luaVM );
949927
CLuaVehicleDefs::AddClass ( luaVM );
950928
}
951929

MTA10/mods/shared_logic/lua/CLuaMain.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ class CLuaMain //: public CClient
7979
void AddPickupClass ( lua_State* luaVM );
8080
void AddColShapeClass ( lua_State* luaVM );
8181
void AddProjectileClass ( lua_State* luaVM );
82-
void AddTeamClass ( lua_State* luaVM );
8382
void AddWaterClass ( lua_State* luaVM );
8483
void AddWeaponClass ( lua_State* luaVM );
8584
void AddEffectClass ( lua_State* luaVM );

MTA10/mods/shared_logic/lua/CLuaManager.cpp

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -653,14 +653,6 @@ void CLuaManager::LoadCFunctions ( void )
653653
CLuaCFunctions::AddFunction ( "createColPolygon", CLuaFunctionDefs::CreateColPolygon );
654654
CLuaCFunctions::AddFunction ( "createColTube", CLuaFunctionDefs::CreateColTube );
655655

656-
// Team get funcs
657-
CLuaCFunctions::AddFunction ( "getTeamFromName", CLuaFunctionDefs::GetTeamFromName );
658-
CLuaCFunctions::AddFunction ( "getTeamName", CLuaFunctionDefs::GetTeamName );
659-
CLuaCFunctions::AddFunction ( "getTeamColor", CLuaFunctionDefs::GetTeamColor );
660-
CLuaCFunctions::AddFunction ( "getTeamFriendlyFire", CLuaFunctionDefs::GetTeamFriendlyFire );
661-
CLuaCFunctions::AddFunction ( "getPlayersInTeam", CLuaFunctionDefs::GetPlayersInTeam );
662-
CLuaCFunctions::AddFunction ( "countPlayersInTeam", CLuaFunctionDefs::CountPlayersInTeam );
663-
664656
// Weapon funcs
665657
CLuaCFunctions::AddFunction ( "getWeaponNameFromID", CLuaFunctionDefs::GetWeaponNameFromID );
666658
CLuaCFunctions::AddFunction ( "getWeaponIDFromName", CLuaFunctionDefs::GetWeaponIDFromName );
@@ -755,5 +747,6 @@ void CLuaManager::LoadCFunctions ( void )
755747
CLuaResourceDefs::LoadFunctions ();
756748
CLuaSearchLightDefs::LoadFunctions ();
757749
CLuaTaskDefs::LoadFunctions ();
750+
CLuaTeamDefs::LoadFunctions ();
758751
CLuaVehicleDefs::LoadFunctions ();
759752
}

0 commit comments

Comments
 (0)