Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8597a0d

Browse files
committed
Removed some unused code.
Conformed addEventHandler() duplicate handle handling.
1 parent cb82a1d commit 8597a0d

File tree

9 files changed

+18
-73
lines changed

9 files changed

+18
-73
lines changed

MTA10/game_sa/CRenderWareSA.cpp

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -446,28 +446,6 @@ CColModel * CRenderWareSA::ReadCOL ( const CBuffer& fileData )
446446
return NULL;
447447
}
448448

449-
// Positions the front seat by reading out the vector from the 'ped_frontseat' atomic in the clump (RpClump*)
450-
// and changing the vector in the CModelInfo class identified by the model id (usModelID)
451-
bool CRenderWareSA::PositionFrontSeat ( RpClump *pClump, unsigned short usModelID )
452-
{
453-
// get the modelinfo array (+5Ch contains a pointer to vehicle specific dummy data)
454-
DWORD *pPool = ( DWORD* ) ARRAY_ModelInfo;
455-
DWORD *pVehicleDummies = ( DWORD* ) ( pPool[usModelID] + 0x5C );
456-
457-
// read out the 'ped_frontseat' frame
458-
RwFrame * pPedFrontSeat = RwFrameFindFrame ( RpGetFrame ( pClump ), "ped_frontseat" );
459-
if ( pPedFrontSeat == NULL )
460-
return false;
461-
462-
// in the vehicle specific dummy data, +30h contains the front seat vector
463-
CVector *vecFrontSeat = ( CVector* ) ( pVehicleDummies + 0x30 );
464-
vecFrontSeat->fX = pPedFrontSeat->modelling.pos.x;
465-
vecFrontSeat->fY = pPedFrontSeat->modelling.pos.y;
466-
vecFrontSeat->fZ = pPedFrontSeat->modelling.pos.z;
467-
468-
return true;
469-
}
470-
471449
// Loads all atomics from a clump into a container struct and returns the number of atomics it loaded
472450
unsigned int CRenderWareSA::LoadAtomics ( RpClump * pClump, RpAtomicContainer * pAtomics )
473451
{

MTA10/game_sa/CRenderWareSA.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,6 @@ class CRenderWareSA : public CRenderWare
6161
// Replaces a CColModel for a specific object identified by the object id (usModelID)
6262
void ReplaceCollisions ( CColModel * pColModel, unsigned short usModelID );
6363

64-
// Positions the front seat by reading out the vector from the 'ped_frontseat' atomic in the clump (RpClump*)
65-
// and changing the vector in the CModelInfo class identified by the model id (usModelID)
66-
bool PositionFrontSeat ( RpClump * pClump, unsigned short usModelID );
67-
6864
// Loads all atomics from a clump into a container struct and returns the number of atomics it loaded
6965
unsigned int LoadAtomics ( RpClump * pClump, RpAtomicContainer * pAtomics );
7066

MTA10/mods/deathmatch/logic/CClientGame.cpp

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1256,20 +1256,6 @@ void CClientGame::DoPulses ( void )
12561256
}
12571257
}
12581258

1259-
// Fire the engine ready event 10 frames after we're ingame
1260-
static int iFrameCount = 0;
1261-
1262-
if ( iFrameCount <= 10 && m_Status == CClientGame::STATUS_JOINED )
1263-
{
1264-
++iFrameCount;
1265-
1266-
// Give the game 5 frames to get ready
1267-
if ( iFrameCount == 10 )
1268-
{
1269-
Event_OnIngameAndReady ();
1270-
}
1271-
}
1272-
12731259
// Check for radar input
12741260
m_pRadarMap->DoPulse ();
12751261
g_pCore->GetGraphics ()->SetAspectRatioAdjustmentSuspended( m_pRadarMap->IsRadarShowing() );
@@ -3610,32 +3596,16 @@ void CClientGame::Event_OnIngame ( void )
36103596
}
36113597

36123598

3613-
void CClientGame::Event_OnIngameAndReady ( void )
3614-
{
3615-
// Fade in
3616-
//m_pCamera->FadeIn ( 1.0f );
3617-
}
3618-
3619-
36203599
void CClientGame::Event_OnIngameAndConnected ( void )
36213600
{
3622-
// Create a messagebox saying that we're verifying the client
3623-
//g_pCore->ShowMessageBox ( "Connecting", _("Verifying client ..."), false );
36243601
m_ulVerifyTimeStart = CClientTime::GetTime ();
36253602

36263603
// Keep criminal records of how many times they've connected to servers
36273604
SetApplicationSettingInt ( "times-connected", GetApplicationSettingInt("times-connected") + 1 );
36283605
if ( m_ServerType == SERVER_TYPE_EDITOR )
36293606
SetApplicationSettingInt ( "times-connected-editor", GetApplicationSettingInt ("times-connected-editor") + 1 );
36303607

3631-
/*
36323608
// Notify the server telling we're ingame
3633-
NetBitStreamInterface* pBitStream = g_pNet->AllocateNetBitStream ();
3634-
if ( pBitStream )
3635-
{
3636-
g_pNet->SendPacket ( PACKET_ID_PLAYER_INGAME_NOTICE, pBitStream );
3637-
g_pNet->DeallocateNetBitStream ( pBitStream );
3638-
}*/
36393609
m_pNetAPI->RPC ( PLAYER_INGAME_NOTICE );
36403610
}
36413611

MTA10/mods/deathmatch/logic/CClientGame.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,6 @@ class CClientGame
486486
void QuitPlayer ( CClientPlayer* pPlayer, eQuitReason Reason );
487487

488488
void Event_OnIngame ( void );
489-
void Event_OnIngameAndReady ( void );
490489
void Event_OnIngameAndConnected ( void );
491490

492491
static bool StaticDamageHandler ( CPed* pDamagePed, CEventDamage * pEvent );

MTA10/mods/shared_logic/CBassAudio.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,7 @@ void CBassAudio::SetPan ( float fPan )
606606
BASS_ChannelSetAttribute( m_pSound, BASS_ATTRIB_PAN, fPan );
607607
}
608608

609-
void CBassAudio::SetVolume ( float fVolume, bool bStore )
609+
void CBassAudio::SetVolume ( float fVolume )
610610
{
611611
m_fVolume = fVolume;
612612

MTA10/mods/shared_logic/CBassAudio.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class CBassAudio
5858
void SetPlayPosition ( double dPosition );
5959
double GetPlayPosition ( void );
6060
double GetLength ( void );
61-
void SetVolume ( float fVolume, bool bStore = true );
61+
void SetVolume ( float fVolume );
6262
void SetPlaybackSpeed ( float fSpeed );
6363
void SetPosition ( const CVector& vecPosition );
6464
void SetVelocity ( const CVector& vecVelocity );

MTA10/mods/shared_logic/lua/CLuaFunctionDefs.Event.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -88,20 +88,20 @@ int CLuaFunctionDefs::AddEventHandler ( lua_State* luaVM )
8888
// Check if the handle is in use
8989
if ( pEntity->GetEventManager()->HandleExists ( pLuaMain, strName, iLuaFunction ) )
9090
{
91-
m_pScriptDebugging->LogCustom ( luaVM, 255, 0, 0, "%s: '%s' with this function is already handled", lua_tostring ( luaVM, lua_upvalueindex ( 1 ) ), *strName );
92-
lua_pushboolean ( luaVM, false );
93-
return 1;
91+
argStream.SetCustomError ( SString ( "'%s' with this function is already handled", *strName ) );
9492
}
95-
96-
// Do it
97-
if ( CStaticFunctionDefinitions::AddEventHandler ( *pLuaMain, strName, *pEntity, iLuaFunction, bPropagated, eventPriority, fPriorityMod ) )
93+
else
9894
{
99-
lua_pushboolean ( luaVM, true );
100-
return 1;
95+
// Do it
96+
if ( CStaticFunctionDefinitions::AddEventHandler ( *pLuaMain, strName, *pEntity, iLuaFunction, bPropagated, eventPriority, fPriorityMod ) )
97+
{
98+
lua_pushboolean ( luaVM, true );
99+
return 1;
100+
}
101101
}
102102
}
103103
}
104-
else
104+
if ( argStream.HasErrors () )
105105
m_pScriptDebugging->LogCustom ( luaVM, argStream.GetFullErrorMessage() );
106106

107107
// Failed

MTA10/sdk/game/CRenderWare.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ class CRenderWare {
7575
virtual void DestroyTXD ( RwTexDictionary * pTXD ) = 0;
7676
virtual void DestroyTexture ( RwTexture * pTex ) = 0;
7777
virtual void ReplaceCollisions ( CColModel * pColModel, unsigned short usModelID ) = 0;
78-
virtual bool PositionFrontSeat ( RpClump *pClump, unsigned short usModelID ) = 0;
7978
virtual unsigned int LoadAtomics ( RpClump * pClump, RpAtomicContainer * pAtomics ) = 0;
8079
virtual void ReplaceAllAtomicsInModel ( RpClump * pSrc, unsigned short usModelID ) = 0;
8180
virtual void ReplaceAllAtomicsInClump ( RpClump * pDst, RpAtomicContainer * pAtomics, unsigned int uiAtomics ) = 0;

MTA10_Server/mods/deathmatch/logic/lua/CLuaFunctionDefs.Event.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,14 @@ int CLuaFunctionDefs::AddEventHandler ( lua_State* luaVM )
100100
{
101101
argStream.SetCustomError ( SString ( "'%s' with this function is already handled", *strName ) );
102102
}
103-
// Do it
104-
if ( CStaticFunctionDefinitions::AddEventHandler ( pLuaMain, strName, pElement, iLuaFunction, bPropagated, eventPriority, fPriorityMod ) )
103+
else
105104
{
106-
lua_pushboolean ( luaVM, true );
107-
return 1;
105+
// Do it
106+
if ( CStaticFunctionDefinitions::AddEventHandler ( pLuaMain, strName, pElement, iLuaFunction, bPropagated, eventPriority, fPriorityMod ) )
107+
{
108+
lua_pushboolean ( luaVM, true );
109+
return 1;
110+
}
108111
}
109112
}
110113
}

0 commit comments

Comments
 (0)