Skip to content

Commit 029c2e9

Browse files
committed
Remove getTrack/Pos & fileGetPath from luadefs
1 parent 4a8ae90 commit 029c2e9

File tree

4 files changed

+1
-159
lines changed

4 files changed

+1
-159
lines changed

MTA10_Server/mods/deathmatch/logic/luadefs/CLuaFileDefs.cpp

Lines changed: 1 addition & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ void CLuaFileDefs::LoadFunctions ( void )
3333
CLuaCFunctions::AddFunction ( "fileDelete", fileDelete );
3434
CLuaCFunctions::AddFunction ( "fileRename", fileRename );
3535
CLuaCFunctions::AddFunction ( "fileCopy", fileCopy );
36-
CLuaCFunctions::AddFunction ( "fileGetPath", fileGetPath );
3736
}
3837

3938

@@ -779,45 +778,4 @@ int CLuaFileDefs::fileCopy ( lua_State* luaVM )
779778
// Failed
780779
lua_pushboolean ( luaVM, false );
781780
return 1;
782-
}
783-
784-
785-
int CLuaFileDefs::fileGetPath( lua_State* luaVM )
786-
{
787-
// string fileGetPath ( file theFile )
788-
CScriptFile* pFile;
789-
790-
CScriptArgReader argStream( luaVM );
791-
argStream.ReadUserData( pFile );
792-
793-
if ( !argStream.HasErrors( ) )
794-
{
795-
// Grab our lua VM
796-
CLuaMain* pLuaMain = m_pLuaManager->GetVirtualMachine( luaVM );
797-
if ( pLuaMain )
798-
{
799-
// We have a resource argument?
800-
CResource* pThisResource = pLuaMain->GetResource( );
801-
CResource* pFileResource = pFile->GetResource( );
802-
803-
const SString& strFilePath = pFile->GetFilePath( );
804-
SString outPath = strFilePath;
805-
806-
// If the calling resource is not the resource the file resides in
807-
// we need to prepend :resourceName to the path
808-
if ( pThisResource != pFileResource )
809-
{
810-
outPath = ":" + pFileResource->GetName() + "/" + outPath;
811-
}
812-
813-
lua_pushlstring( luaVM, outPath.c_str( ), outPath.length( ) );
814-
return 1;
815-
}
816-
}
817-
else
818-
m_pScriptDebugging->LogCustom( luaVM, argStream.GetFullErrorMessage( ) );
819-
820-
// Failed
821-
lua_pushboolean( luaVM, false );
822-
return 1;
823-
}
781+
}

MTA10_Server/mods/deathmatch/logic/luadefs/CLuaFileDefs.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,4 @@ class CLuaFileDefs: public CLuaDefs
3636
LUA_DECLARE ( fileDelete );
3737
LUA_DECLARE ( fileRename );
3838
LUA_DECLARE ( fileCopy );
39-
LUA_DECLARE ( fileGetPath );
4039
};

MTA10_Server/mods/deathmatch/logic/luadefs/CLuaVehicleDefs.cpp

Lines changed: 0 additions & 111 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,6 @@ void CLuaVehicleDefs::LoadFunctions()
5656
CLuaCFunctions::AddFunction ( "isTrainDerailable", IsTrainDerailable );
5757
CLuaCFunctions::AddFunction ( "getTrainDirection", GetTrainDirection );
5858
CLuaCFunctions::AddFunction ( "getTrainSpeed", GetTrainSpeed );
59-
CLuaCFunctions::AddFunction ( "getTrainTrack", GetTrainTrack );
60-
CLuaCFunctions::AddFunction ( "getTrainPosition", GetTrainPosition );
6159
CLuaCFunctions::AddFunction ( "isVehicleBlown", IsVehicleBlown );
6260
CLuaCFunctions::AddFunction ( "getVehicleHeadLightColor", GetVehicleHeadLightColor );
6361
CLuaCFunctions::AddFunction ( "getVehicleDoorOpenRatio", GetVehicleDoorOpenRatio );
@@ -101,8 +99,6 @@ void CLuaVehicleDefs::LoadFunctions()
10199
CLuaCFunctions::AddFunction ( "setTrainDerailable", SetTrainDerailable );
102100
CLuaCFunctions::AddFunction ( "setTrainDirection", SetTrainDirection );
103101
CLuaCFunctions::AddFunction ( "setTrainSpeed", SetTrainSpeed );
104-
CLuaCFunctions::AddFunction ( "setTrainTrack", SetTrainTrack );
105-
CLuaCFunctions::AddFunction ( "setTrainPosition", SetTrainPosition );
106102
CLuaCFunctions::AddFunction ( "setVehicleHeadLightColor", SetVehicleHeadLightColor );
107103
CLuaCFunctions::AddFunction ( "setVehicleTurretPosition", SetVehicleTurretPosition );
108104
CLuaCFunctions::AddFunction ( "setVehicleDoorOpenRatio", SetVehicleDoorOpenRatio );
@@ -156,8 +152,6 @@ void CLuaVehicleDefs::AddClass ( lua_State* luaVM )
156152
lua_classfunction ( luaVM, "getSirens", "getVehicleSirens" );
157153
lua_classfunction ( luaVM, "getDirection", "getTrainDirection" );
158154
lua_classfunction ( luaVM, "getTrainSpeed", "getTrainSpeed" );
159-
lua_classfunction ( luaVM, "getTrack", "getTrainTrack" );
160-
lua_classfunction ( luaVM, "getTrainPosition", "getTrainPosition" );
161155
lua_classfunction ( luaVM, "getHeadLightColor", "getVehicleHeadLightColor" );
162156
lua_classfunction ( luaVM, "getColor", "getVehicleColor" );
163157
lua_classfunction ( luaVM, "getCompatibleUpgrades", "getVehicleCompatibleUpgrades" );
@@ -215,8 +209,6 @@ void CLuaVehicleDefs::AddClass ( lua_State* luaVM )
215209
lua_classfunction ( luaVM, "setDerailable", "setTrainDerailable" );
216210
lua_classfunction ( luaVM, "setDerailed", "setTrainDerailed" );
217211
lua_classfunction ( luaVM, "setDirection", "setTrainDirection" );
218-
lua_classfunction ( luaVM, "setTrack", "setTrainTrack" );
219-
lua_classfunction ( luaVM, "setTrainPosition", "setTrainPosition" );
220212
lua_classfunction ( luaVM, "setTrainSpeed", "setTrainSpeed" ); // Reduce confusion
221213

222214
lua_classvariable ( luaVM, "damageProof", "setVehicleDamageProof", "isVehicleDamageProof" );
@@ -226,8 +218,6 @@ void CLuaVehicleDefs::AddClass ( lua_State* luaVM )
226218
lua_classvariable ( luaVM, "blown", "blowVehicle", "isVehicleBlown" );
227219
lua_classvariable ( luaVM, "direction", "setTrainDirection", "getTrainDirection" );
228220
lua_classvariable ( luaVM, "trainSpeed", "setTrainSpeed", "getTrainSpeed" );
229-
lua_classvariable ( luaVM, "track", "setTrainTrack", "getTrainTrack" );
230-
lua_classvariable ( luaVM, "trainPosition", "getTrainPosition", "getTrainPosition" );
231221
lua_classvariable ( luaVM, "taxiLightOn", "setVehicleTaxiLightOn", "isVehicleTaxiLightOn" );
232222
lua_classvariable ( luaVM, "fuelTankExplodable", "setVehicleFuelTankExplodable", "isVehicleFuelTankExplodable" );
233223
lua_classvariable ( luaVM, "plateText", "setVehiclePlateText", "getVehiclePlateText" );
@@ -1715,54 +1705,6 @@ int CLuaVehicleDefs::GetTrainSpeed ( lua_State* luaVM )
17151705
}
17161706

17171707

1718-
int CLuaVehicleDefs::GetTrainPosition ( lua_State* luaVM )
1719-
{
1720-
CVehicle* pVehicle;
1721-
1722-
CScriptArgReader argStream ( luaVM );
1723-
argStream.ReadUserData ( pVehicle );
1724-
1725-
if ( !argStream.HasErrors () )
1726-
{
1727-
float fPosition;
1728-
if ( CStaticFunctionDefinitions::GetTrainPosition ( pVehicle, fPosition ) )
1729-
{
1730-
lua_pushnumber ( luaVM, fPosition );
1731-
return 1;
1732-
}
1733-
}
1734-
else
1735-
m_pScriptDebugging->LogCustom ( luaVM, argStream.GetFullErrorMessage () );
1736-
1737-
lua_pushboolean ( luaVM, false );
1738-
return 1;
1739-
}
1740-
1741-
1742-
int CLuaVehicleDefs::GetTrainTrack ( lua_State* luaVM )
1743-
{
1744-
CVehicle* pVehicle;
1745-
1746-
CScriptArgReader argStream ( luaVM );
1747-
argStream.ReadUserData ( pVehicle );
1748-
1749-
if ( !argStream.HasErrors () )
1750-
{
1751-
uchar ucTrack;
1752-
if ( CStaticFunctionDefinitions::GetTrainTrack ( pVehicle, ucTrack ) )
1753-
{
1754-
lua_pushnumber ( luaVM, ucTrack );
1755-
return 1;
1756-
}
1757-
}
1758-
else
1759-
m_pScriptDebugging->LogCustom ( luaVM, argStream.GetFullErrorMessage () );
1760-
1761-
lua_pushboolean ( luaVM, false );
1762-
return 1;
1763-
}
1764-
1765-
17661708
int CLuaVehicleDefs::FixVehicle ( lua_State* luaVM )
17671709
{
17681710
CElement* pElement;
@@ -2766,59 +2708,6 @@ int CLuaVehicleDefs::SetTrainSpeed ( lua_State* luaVM )
27662708
}
27672709

27682710

2769-
int CLuaVehicleDefs::SetTrainTrack ( lua_State* luaVM )
2770-
{
2771-
CVehicle* pVehicle;
2772-
uchar ucTrack;
2773-
2774-
CScriptArgReader argStream ( luaVM );
2775-
argStream.ReadUserData ( pVehicle );
2776-
argStream.ReadNumber ( ucTrack );
2777-
2778-
if ( !argStream.HasErrors () )
2779-
{
2780-
if ( ( ucTrack >= 0 ) && ( ucTrack <= 3 ) ) {
2781-
if ( CStaticFunctionDefinitions::SetTrainTrack ( pVehicle, ucTrack ) )
2782-
{
2783-
lua_pushboolean ( luaVM, true );
2784-
return 1;
2785-
}
2786-
}
2787-
m_pScriptDebugging->LogCustom ( luaVM, "track number should be between 0 and 3 inclusive" );
2788-
}
2789-
else
2790-
m_pScriptDebugging->LogCustom ( luaVM, argStream.GetFullErrorMessage () );
2791-
2792-
lua_pushboolean ( luaVM, false );
2793-
return 1;
2794-
}
2795-
2796-
2797-
int CLuaVehicleDefs::SetTrainPosition ( lua_State* luaVM )
2798-
{
2799-
CVehicle* pVehicle;
2800-
float fPosition;
2801-
2802-
CScriptArgReader argStream ( luaVM );
2803-
argStream.ReadUserData ( pVehicle );
2804-
argStream.ReadNumber ( fPosition );
2805-
2806-
if ( !argStream.HasErrors () )
2807-
{
2808-
if ( CStaticFunctionDefinitions::SetTrainPosition ( pVehicle, fPosition ) )
2809-
{
2810-
lua_pushboolean ( luaVM, true );
2811-
return 1;
2812-
}
2813-
}
2814-
else
2815-
m_pScriptDebugging->LogCustom ( luaVM, argStream.GetFullErrorMessage () );
2816-
2817-
lua_pushboolean ( luaVM, false );
2818-
return 1;
2819-
}
2820-
2821-
28222711
int CLuaVehicleDefs::SetVehicleHeadLightColor ( lua_State* luaVM )
28232712
{
28242713
CVehicle* pVehicle;

MTA10_Server/mods/deathmatch/logic/luadefs/CLuaVehicleDefs.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,6 @@ class CLuaVehicleDefs : public CLuaDefs
6161
LUA_DECLARE ( IsTrainDerailable );
6262
LUA_DECLARE ( GetTrainDirection );
6363
LUA_DECLARE ( GetTrainSpeed );
64-
LUA_DECLARE ( GetTrainTrack );
65-
LUA_DECLARE ( GetTrainPosition );
6664
LUA_DECLARE ( IsVehicleBlown );
6765
LUA_DECLARE ( GetVehicleHeadLightColor );
6866
LUA_DECLARE ( GetVehicleDoorOpenRatio );
@@ -107,8 +105,6 @@ class CLuaVehicleDefs : public CLuaDefs
107105
LUA_DECLARE ( SetTrainDerailable );
108106
LUA_DECLARE ( SetTrainDirection );
109107
LUA_DECLARE ( SetTrainSpeed );
110-
LUA_DECLARE ( SetTrainTrack );
111-
LUA_DECLARE ( SetTrainPosition );
112108
LUA_DECLARE ( SetVehicleHeadLightColor );
113109
LUA_DECLARE ( SetVehicleTurretPosition );
114110
LUA_DECLARE ( SetVehicleDoorOpenRatio );

0 commit comments

Comments
 (0)