Match CScriptSpecialFunction::DeleteEmitter

This commit is contained in:
Henrique Gemignani Passos Lima 2022-10-03 18:59:07 +03:00
parent 07147d4057
commit e48f6478f9
No known key found for this signature in database
GPG Key ID: E224F951761145F8
3 changed files with 6 additions and 6 deletions

View File

@ -14,6 +14,7 @@ public:
bool operator==(const CSfxHandle& other) { return mID == other.mID; }
bool operator!=(const CSfxHandle& other) { return mID != other.mID; }
operator bool() const { return mID != 0; }
void Clear() { mID = 0; }
private:
uint mID;

View File

@ -141,7 +141,7 @@ public:
bool ShouldSkipCinematic(CStateManager& stateMgr) const;
void DeleteEmitter(const CSfxHandle& handle);
void DeleteEmitter(CSfxHandle& handle);
u32 GetSpecialEnding(const CStateManager&) const;
void AddOrUpdateEmitter(float pitch, CSfxHandle& handle, u16 id, const CVector3f& pos, uchar vol);
};

View File

@ -1078,12 +1078,11 @@ void CScriptSpecialFunction::ThinkPlayerInArea(float dt, CStateManager& mgr) {
}
}
void CScriptSpecialFunction::DeleteEmitter(const CSfxHandle& handle) {
if (!handle) {
return;
void CScriptSpecialFunction::DeleteEmitter(CSfxHandle& handle) {
if (handle) {
CSfxManager::RemoveEmitter(handle);
handle.Clear();
}
CSfxManager::RemoveEmitter(handle);
}
u32 CScriptSpecialFunction::GetSpecialEnding(const CStateManager& mgr) const {