File tree Expand file tree Collapse file tree 2 files changed +54
-0
lines changed Expand file tree Collapse file tree 2 files changed +54
-0
lines changed Original file line number Diff line number Diff line change 26
26
#include " CWorldSA.h"
27
27
#include " CKeyGenSA.h"
28
28
#include " CFileLoaderSA.h"
29
+ #include " CPtrNodeSingleListSA.h"
29
30
30
31
extern CGameSA* pGame;
31
32
@@ -410,6 +411,14 @@ void CPoolsSA::RemoveBuilding(CBuilding* pBuilding)
410
411
// Remove building from world
411
412
pGame->GetWorld ()->Remove (pInterface, CBuildingPool_Destructor);
412
413
414
+ // Remove building from cover list
415
+ CPtrNodeSingleListSAInterface<CBuildingSAInterface>* coverList = reinterpret_cast <CPtrNodeSingleListSAInterface<CBuildingSAInterface>*>(0xC1A2B8 );
416
+ coverList->RemoveItem (pInterface);
417
+
418
+ // Remove plant
419
+ using CPlantColEntry_Remove = CEntitySAInterface* (*)(CEntitySAInterface*);
420
+ ((CPlantColEntry_Remove)0x5DBEF0 )(pInterface);
421
+
413
422
// Remove col reference
414
423
auto modelInfo = pGame->GetModelInfo (pBuilding->GetModelIndex ());
415
424
modelInfo->RemoveColRef ();
Original file line number Diff line number Diff line change
1
+ /* ****************************************************************************
2
+ *
3
+ * PROJECT: Multi Theft Auto v1.0
4
+ * LICENSE: See LICENSE in the top level directory
5
+ * FILE: game_sa/CPtrNodeSingleListSA.cpp
6
+ *
7
+ * Multi Theft Auto is available from http://www.multitheftauto.com/
8
+ *
9
+ *****************************************************************************/
10
+
11
+ #pragma once
12
+
13
+ template <class T >
14
+ struct CPtrNodeSingleLink
15
+ {
16
+ T* pItem;
17
+ CPtrNodeSingleLink* pNext;
18
+ };
19
+
20
+ template <class T >
21
+ class CPtrNodeSingleListSAInterface
22
+ {
23
+ public:
24
+ void RemoveItem (T* item);
25
+ void RemoveAllItems ();
26
+
27
+ private:
28
+ CPtrNodeSingleLink<T>* m_pList;
29
+ };
30
+
31
+ template <class T >
32
+ void CPtrNodeSingleListSAInterface<T>::RemoveItem(T* item)
33
+ {
34
+ using CPtrNodeSingleList_RemoveItem_t = void (__thiscall*)(CPtrNodeSingleListSAInterface<T> * pLinkList, void * item);
35
+ ((CPtrNodeSingleList_RemoveItem_t)0x533610 )(this , item);
36
+ }
37
+
38
+ template <class T >
39
+ void CPtrNodeSingleListSAInterface<T>::RemoveAllItems()
40
+ {
41
+ while (m_pList)
42
+ {
43
+ RemoveItem (m_pList->pItem );
44
+ }
45
+ }
You can’t perform that action at this time.
0 commit comments