Skip to content

Commit

Permalink
UPBGE: Use CM_ListRemoveIfFound in SCA_IObject.
Browse files Browse the repository at this point in the history
  • Loading branch information
panzergame committed Dec 31, 2017
1 parent 986e236 commit 48e2862
Showing 1 changed file with 4 additions and 16 deletions.
20 changes: 4 additions & 16 deletions source/gameengine/GameLogic/SCA_IObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
#include "SCA_IActuator.h"
#include "EXP_ListValue.h"

#include "CM_List.h"

SG_QList SCA_IObject::m_activeBookmarkedControllers;

SCA_IObject::SCA_IObject()
Expand Down Expand Up @@ -152,14 +154,7 @@ void SCA_IObject::RegisterActuator(SCA_IActuator *act)

void SCA_IObject::UnregisterActuator(SCA_IActuator *act)
{
for (SCA_ActuatorList::iterator ita = m_registeredActuators.begin(); ita != m_registeredActuators.end();) {
if (*ita == act) {
ita = m_registeredActuators.erase(ita);
}
else {
++ita;
}
}
CM_ListRemoveIfFound(m_registeredActuators, act);
}

void SCA_IObject::RegisterObject(SCA_IObject *obj)
Expand All @@ -171,14 +166,7 @@ void SCA_IObject::RegisterObject(SCA_IObject *obj)

void SCA_IObject::UnregisterObject(SCA_IObject *obj)
{
for (SCA_ObjectList::iterator ito = m_registeredObjects.begin(); ito != m_registeredObjects.end();) {
if (*ito == obj) {
ito = m_registeredObjects.erase(ito);
}
else {
++ito;
}
}
CM_ListRemoveIfFound(m_registeredObjects, obj);
}

bool SCA_IObject::UnlinkObject(SCA_IObject *clientobj)
Expand Down

0 comments on commit 48e2862

Please sign in to comment.