Skip to content

Commit b47310f

Browse files
committed
Revert "Return vectors for vehicles component funcs (fixes mantis 9507)"
This reverts commit ee0858e.
1 parent 8748d7e commit b47310f

File tree

2 files changed

+5
-62
lines changed

2 files changed

+5
-62
lines changed

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

Lines changed: 3 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -189,9 +189,9 @@ void CLuaVehicleDefs::AddClass ( lua_State* luaVM )
189189
lua_classfunction ( luaVM, "getSirenParams", "getVehicleSirenParams" );
190190
lua_classfunction ( luaVM, "getSirens", "getVehicleSirens" );
191191
lua_classfunction ( luaVM, "getSirensOn", "getVehicleSirensOn" );
192-
lua_classfunction ( luaVM, "getComponentPosition", OOP_GetVehicleComponentPosition );
192+
lua_classfunction ( luaVM, "getComponentPosition", "getVehicleComponentPosition" );
193193
lua_classfunction ( luaVM, "getComponentVisible", "getVehicleComponentVisible" );
194-
lua_classfunction ( luaVM, "getComponentRotation", OOP_GetVehicleComponentRotation );
194+
lua_classfunction ( luaVM, "getComponentRotation", "getVehicleComponentRotation" );
195195
lua_classfunction ( luaVM, "getUpgrades", "getVehicleUpgrades" );
196196
lua_classfunction ( luaVM, "getUpgradeSlotName", "getVehicleUpgradeSlotName" );
197197
lua_classfunction ( luaVM, "getCompatibleUpgrades", "getVehicleCompatibleUpgrades" );
@@ -3040,6 +3040,7 @@ int CLuaVehicleDefs::SetVehicleComponentPosition ( lua_State* luaVM )
30403040
return 1;
30413041
}
30423042

3043+
30433044
int CLuaVehicleDefs::GetVehicleComponentPosition ( lua_State* luaVM )
30443045
{
30453046
// float, float, float getVehicleComponentPosition ( vehicle theVehicle, string theComponent [, string base = "root"] )
@@ -3070,34 +3071,6 @@ int CLuaVehicleDefs::GetVehicleComponentPosition ( lua_State* luaVM )
30703071
return 1;
30713072
}
30723073

3073-
int CLuaVehicleDefs::OOP_GetVehicleComponentPosition ( lua_State* luaVM )
3074-
{
3075-
// float, float, float getVehicleComponentPosition ( vehicle theVehicle, string theComponent [, string base = "root"] )
3076-
SString strComponent;
3077-
CClientVehicle * pVehicle = NULL;
3078-
EComponentBaseType outputBase;
3079-
3080-
CScriptArgReader argStream ( luaVM );
3081-
argStream.ReadUserData ( pVehicle );
3082-
argStream.ReadString ( strComponent );
3083-
argStream.ReadEnumString ( outputBase, EComponentBase::ROOT );
3084-
3085-
if ( !argStream.HasErrors () )
3086-
{
3087-
CVector vecPosition;
3088-
if ( pVehicle->GetComponentPosition ( strComponent, vecPosition, outputBase ) )
3089-
{
3090-
lua_pushvector ( luaVM, vecPosition );
3091-
return 1;
3092-
}
3093-
}
3094-
else
3095-
m_pScriptDebugging->LogCustom ( luaVM, argStream.GetFullErrorMessage () );
3096-
3097-
lua_pushboolean ( luaVM, false );
3098-
return 1;
3099-
}
3100-
31013074
int CLuaVehicleDefs::SetVehicleComponentRotation ( lua_State* luaVM )
31023075
{
31033076
// bool setVehicleComponentRotation ( vehicle theVehicle, string theComponent, float rotX, float rotY, float rotZ [, string base = "parent"] )
@@ -3159,36 +3132,6 @@ int CLuaVehicleDefs::GetVehicleComponentRotation ( lua_State* luaVM )
31593132
return 1;
31603133
}
31613134

3162-
int CLuaVehicleDefs::OOP_GetVehicleComponentRotation ( lua_State* luaVM )
3163-
{
3164-
// float, float, float getVehicleComponentRotation ( vehicle theVehicle, string theComponent [, string base = "parent"] )
3165-
SString strComponent;
3166-
CClientVehicle * pVehicle = NULL;
3167-
EComponentBaseType outputBase;
3168-
3169-
CScriptArgReader argStream ( luaVM );
3170-
argStream.ReadUserData ( pVehicle );
3171-
argStream.ReadString ( strComponent );
3172-
argStream.ReadEnumString ( outputBase, EComponentBase::PARENT );
3173-
3174-
if ( !argStream.HasErrors () )
3175-
{
3176-
CVector vecRotation;
3177-
if ( pVehicle->GetComponentRotation ( strComponent, vecRotation, outputBase ) )
3178-
{
3179-
// Script uses degrees
3180-
ConvertRadiansToDegrees ( vecRotation );
3181-
lua_pushvector ( luaVM, vecRotation );
3182-
return 1;
3183-
}
3184-
}
3185-
else
3186-
m_pScriptDebugging->LogCustom ( luaVM, argStream.GetFullErrorMessage () );
3187-
3188-
lua_pushboolean ( luaVM, false );
3189-
return 1;
3190-
}
3191-
31923135
int CLuaVehicleDefs::ResetVehicleComponentPosition ( lua_State* luaVM )
31933136
{
31943137
CScriptArgReader argStream ( luaVM );

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,9 @@ class CLuaVehicleDefs : public CLuaDefs
136136

137137
// Components
138138
LUA_DECLARE ( SetVehicleComponentPosition );
139-
LUA_DECLARE_OOP ( GetVehicleComponentPosition );
139+
LUA_DECLARE ( GetVehicleComponentPosition );
140140
LUA_DECLARE ( SetVehicleComponentRotation );
141-
LUA_DECLARE_OOP ( GetVehicleComponentRotation );
141+
LUA_DECLARE ( GetVehicleComponentRotation );
142142
LUA_DECLARE ( ResetVehicleComponentPosition );
143143
LUA_DECLARE ( ResetVehicleComponentRotation );
144144
LUA_DECLARE ( SetVehicleComponentVisible );

0 commit comments

Comments
 (0)