forked from multitheftauto/mtasa-blue
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0de7d96
commit f8e7139
Showing
28 changed files
with
508 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/***************************************************************************** | ||
* | ||
* PROJECT: Multi Theft Auto v1.0 | ||
* LICENSE: See LICENSE in the top level directory | ||
* FILE: game_sa/CBuildingSA.cpp | ||
* PURPOSE: Building entity | ||
* | ||
* Multi Theft Auto is available from http://www.multitheftauto.com/ | ||
* | ||
*****************************************************************************/ | ||
|
||
#include "StdInc.h" | ||
#include "CBuildingSA.h" | ||
|
||
CBuildingSA::CBuildingSA(CBuildingSAInterface* pInterface) | ||
{ | ||
SetInterface(pInterface); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/***************************************************************************** | ||
* | ||
* PROJECT: Multi Theft Auto v1.0 | ||
* LICENSE: See LICENSE in the top level directory | ||
* FILE: game_sa/CBuildingSA.h | ||
* PURPOSE: Header file for game building class | ||
* | ||
* Multi Theft Auto is available from http://www.multitheftauto.com/ | ||
* | ||
*****************************************************************************/ | ||
|
||
#pragma once | ||
|
||
#include <game/CBuilding.h> | ||
#include "CEntitySA.h" | ||
|
||
class CBuildingSAInterface : public CEntitySAInterface | ||
{ | ||
}; | ||
static_assert(sizeof(CBuildingSAInterface) == 0x38, "Invalid size CBuildingSAInterface"); | ||
|
||
class CBuildingSA final : public virtual CBuilding, public virtual CEntitySA | ||
{ | ||
public: | ||
CBuildingSA(CBuildingSAInterface* pInterface); | ||
|
||
CBuildingSAInterface* GetBuildingInterface() { return reinterpret_cast<CBuildingSAInterface*>(GetInterface()); }; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/***************************************************************************** | ||
* | ||
* PROJECT: Multi Theft Auto v1.0 | ||
* (Shared logic for modifications) | ||
* LICENSE: See LICENSE in the top level directory | ||
* FILE: mods/shared_logic/CClientBuilding.cpp | ||
* PURPOSE: Buildings handling class | ||
* | ||
*****************************************************************************/ | ||
|
||
#include "StdInc.h" | ||
|
||
CClientBuilding::CClientBuilding(class CClientManager* pManager, ElementID ID, uint16_t usModelId, CVector pos, CVector4D rot, uint8_t interior) | ||
: ClassInit(this), | ||
CClientEntity(ID), | ||
m_pBuildingManager(pManager->GetBuildingManager()), | ||
m_usModelId(usModelId), | ||
m_vPos(pos), | ||
m_vRot(rot), | ||
m_interior(interior) | ||
{ | ||
m_pBuilding = nullptr; | ||
m_pManager = pManager; | ||
SetTypeName("building"); | ||
m_pBuildingManager->AddToList(this); | ||
Create(); | ||
} | ||
|
||
CClientBuilding::~CClientBuilding() | ||
{ | ||
m_pBuildingManager->RemoveFromList(this); | ||
if (m_pBuilding) | ||
{ | ||
Destroy(); | ||
} | ||
} | ||
|
||
void CClientBuilding::Create() | ||
{ | ||
if (m_pBuilding) | ||
return; | ||
|
||
m_pBuilding = g_pGame->GetPools()->AddBuilding(this, m_usModelId, m_vPos, m_vRot, m_interior); | ||
} | ||
|
||
void CClientBuilding::Destroy() | ||
{ | ||
if (m_pBuilding) | ||
{ | ||
g_pGame->GetPools()->RemoveBuilding(m_pBuilding); | ||
m_pBuilding = nullptr; | ||
} | ||
} |
Oops, something went wrong.