[Scummvm-git-logs] scummvm master -> fa57a737041348f1a379f17814ca640ab3ca4775

sev- noreply at scummvm.org
Sun Nov 19 16:17:16 UTC 2023


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
fa57a73704 SLUDGE: Fix bug in logic for removing objects


Commit: fa57a737041348f1a379f17814ca640ab3ca4775
    https://github.com/scummvm/scummvm/commit/fa57a737041348f1a379f17814ca640ab3ca4775
Author: polyesterswing (kurianjojo2004 at gmail.com)
Date: 2023-11-19T17:17:12+01:00

Commit Message:
SLUDGE: Fix bug in logic for removing objects

In frasse 1.03, if you go up then right and try to pick up the box, the
game would sometimes crash.

Changed paths:
    engines/sludge/objtypes.cpp
    engines/sludge/people.cpp


diff --git a/engines/sludge/objtypes.cpp b/engines/sludge/objtypes.cpp
index 922d7b7d38e..ef2a18c6b04 100644
--- a/engines/sludge/objtypes.cpp
+++ b/engines/sludge/objtypes.cpp
@@ -134,10 +134,8 @@ int ObjectManager::getCombinationFunction(int withThis, int thisObject) {
 }
 
 void ObjectManager::removeObjectType(ObjectType *oT) {
-	_allObjectTypes.remove(oT);
 	delete []oT->allCombis;
-	delete oT;
-	oT = nullptr;
+	_allObjectTypes.remove(oT);
 }
 
 } // End of namespace Sludge
diff --git a/engines/sludge/people.cpp b/engines/sludge/people.cpp
index f4c2dc44397..975dea6a651 100644
--- a/engines/sludge/people.cpp
+++ b/engines/sludge/people.cpp
@@ -871,10 +871,8 @@ void PeopleManager::removeOneCharacter(int i) {
 			abortFunction(removePerson->continueAfterWalking);
 		removePerson->continueAfterWalking = NULL;
 
-		_allPeople->remove(removePerson);
 		_vm->_objMan->removeObjectType(removePerson->thisType);
-		delete removePerson;
-		removePerson = nullptr;
+		_allPeople->remove(removePerson);
 	}
 }
 




More information about the Scummvm-git-logs mailing list