Avoid more useless `fullName` calls, kaetemi/ryzomclassic#152

ryzomclassic-develop
kaetemi 4 years ago
parent ccb141672f
commit c71f516ed2

@ -131,9 +131,12 @@ public:
nlassert(randVal<=_weights[i]); // "BUG: Random value outside random range!" nlassert(randVal<=_weights[i]); // "BUG: Random value outside random range!"
#endif #endif
entity->getDebugHistory()->addHistory("GRP State Change: %s => %s", if (entity->getDebugHistory()->isRecording())
entity->getState()->getAliasNode()->fullName().c_str(), {
_states[i]->getAliasNode()->fullName().c_str()); entity->getDebugHistory()->addHistory("GRP State Change: %s => %s",
entity->getState()->getAliasNode()->fullName().c_str(),
_states[i]->getAliasNode()->fullName().c_str());
}
entity->setNextState(_states[i]); entity->setNextState(_states[i]);
return true; return true;
@ -198,9 +201,12 @@ public:
} }
uint i=CAIS::rand16((uint32)_states.size()); uint i=CAIS::rand16((uint32)_states.size());
entity->getDebugHistory()->addHistory("GRP State Change: %s => %s", if (entity->getDebugHistory()->isRecording())
entity->getState()->getAliasNode()->fullName().c_str(), {
_states[i]->getAliasNode()->fullName().c_str()); entity->getDebugHistory()->addHistory("GRP State Change: %s => %s",
entity->getState()->getAliasNode()->fullName().c_str(),
_states[i]->getAliasNode()->fullName().c_str());
}
entity->setNextState(_states[i]); entity->setNextState(_states[i]);
return true; return true;
@ -514,9 +520,12 @@ public:
nlwarning("begin_punctual_state failed because state list is empty"); nlwarning("begin_punctual_state failed because state list is empty");
return false; return false;
} }
entity->setNextPunctualState(_states[CAIS::rand16((uint32)_states.size())]); entity->setNextPunctualState(_states[CAIS::rand16((uint32)_states.size())]);
entity->getDebugHistory()->addHistory("GRP BeginPunctual State: %s", if (entity->getDebugHistory()->isRecording())
entity->getNextPunctualState()->getAliasNode()->fullName().c_str()); {
entity->getDebugHistory()->addHistory("GRP BeginPunctual State: %s",
entity->getNextPunctualState()->getAliasNode()->fullName().c_str());
}
return true; return true;
} }
@ -548,8 +557,11 @@ public:
// depending on the whim of the level designers // depending on the whim of the level designers
virtual bool executeAction(CStateInstance *entity,const IAIEvent *event) virtual bool executeAction(CStateInstance *entity,const IAIEvent *event)
{ {
entity->getDebugHistory()->addHistory("GRP End Punctual State: %s", if (entity->getDebugHistory()->isRecording())
entity->getPunctualState()->getAliasNode()->fullName().c_str()); {
entity->getDebugHistory()->addHistory("GRP End Punctual State: %s",
entity->getPunctualState()->getAliasNode()->fullName().c_str());
}
entity->cancelPunctualState(); entity->cancelPunctualState();
return true; return true;

Loading…
Cancel
Save