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
if (entity->getDebugHistory()->isRecording())
{
entity->getDebugHistory()->addHistory("GRP State Change: %s => %s", entity->getDebugHistory()->addHistory("GRP State Change: %s => %s",
entity->getState()->getAliasNode()->fullName().c_str(), entity->getState()->getAliasNode()->fullName().c_str(),
_states[i]->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());
if (entity->getDebugHistory()->isRecording())
{
entity->getDebugHistory()->addHistory("GRP State Change: %s => %s", entity->getDebugHistory()->addHistory("GRP State Change: %s => %s",
entity->getState()->getAliasNode()->fullName().c_str(), entity->getState()->getAliasNode()->fullName().c_str(),
_states[i]->getAliasNode()->fullName().c_str()); _states[i]->getAliasNode()->fullName().c_str());
}
entity->setNextState(_states[i]); entity->setNextState(_states[i]);
return true; return true;
@ -515,8 +521,11 @@ public:
return false; return false;
} }
entity->setNextPunctualState(_states[CAIS::rand16((uint32)_states.size())]); entity->setNextPunctualState(_states[CAIS::rand16((uint32)_states.size())]);
if (entity->getDebugHistory()->isRecording())
{
entity->getDebugHistory()->addHistory("GRP BeginPunctual State: %s", entity->getDebugHistory()->addHistory("GRP BeginPunctual State: %s",
entity->getNextPunctualState()->getAliasNode()->fullName().c_str()); entity->getNextPunctualState()->getAliasNode()->fullName().c_str());
}
return true; return true;
} }
@ -547,9 +556,12 @@ public:
// NOTE: This code should be fast and compact as it may be called very large numbers of times // NOTE: This code should be fast and compact as it may be called very large numbers of times
// 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)
{
if (entity->getDebugHistory()->isRecording())
{ {
entity->getDebugHistory()->addHistory("GRP End Punctual State: %s", entity->getDebugHistory()->addHistory("GRP End Punctual State: %s",
entity->getPunctualState()->getAliasNode()->fullName().c_str()); entity->getPunctualState()->getAliasNode()->fullName().c_str());
}
entity->cancelPunctualState(); entity->cancelPunctualState();
return true; return true;

Loading…
Cancel
Save