-
-
Notifications
You must be signed in to change notification settings - Fork 438
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix crashes caused by createBuilding with engineRequestModel (#3330)
Bugs fixed: 1) Crash occurs when a resource that uses createBuilding with engineRequestModel is stopped 2) Destroyed building leaves grass
- Loading branch information
1 parent
229389a
commit 6245a68
Showing
2 changed files
with
54 additions
and
0 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
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,45 @@ | ||
/***************************************************************************** | ||
* | ||
* PROJECT: Multi Theft Auto v1.0 | ||
* LICENSE: See LICENSE in the top level directory | ||
* FILE: game_sa/CPtrNodeSingleListSA.cpp | ||
* | ||
* Multi Theft Auto is available from http://www.multitheftauto.com/ | ||
* | ||
*****************************************************************************/ | ||
|
||
#pragma once | ||
|
||
template <class T> | ||
struct CPtrNodeSingleLink | ||
{ | ||
T* pItem; | ||
CPtrNodeSingleLink* pNext; | ||
}; | ||
|
||
template <class T> | ||
class CPtrNodeSingleListSAInterface | ||
{ | ||
public: | ||
void RemoveItem(T* item); | ||
void RemoveAllItems(); | ||
|
||
private: | ||
CPtrNodeSingleLink<T>* m_pList; | ||
}; | ||
|
||
template <class T> | ||
void CPtrNodeSingleListSAInterface<T>::RemoveItem(T* item) | ||
{ | ||
using CPtrNodeSingleList_RemoveItem_t = void(__thiscall*)(CPtrNodeSingleListSAInterface<T> * pLinkList, void* item); | ||
((CPtrNodeSingleList_RemoveItem_t)0x533610)(this, item); | ||
} | ||
|
||
template <class T> | ||
void CPtrNodeSingleListSAInterface<T>::RemoveAllItems() | ||
{ | ||
while (m_pList) | ||
{ | ||
RemoveItem(m_pList->pItem); | ||
} | ||
} |