[GEN] Backports redundant call reductions from ZH#750
[GEN] Backports redundant call reductions from ZH#750tomsons26 wants to merge 1 commit intoTheSuperHackers:mainfrom
Conversation
xezon
left a comment
There was a problem hiding this comment.
Looks safe in principle, but a few notes added.
|
|
||
| Object* goalObj = getStateMachine()->getGoalObject(); | ||
| if (goalObj && goalObj->getID() == fromID) | ||
| getStateMachine()->setGoalObject(TheGameLogic->findObjectByID(toID)); |
There was a problem hiding this comment.
This is not a good change. I suggest to sync Generals to Zero Hour.
| Object *obj = getObject(); | ||
| if (!isDieApplicable(damageInfo)) | ||
| return; | ||
| TheGameLogic->destroyObject(getObject()); |
There was a problem hiding this comment.
This is not a good change. I suggest to sync Generals to Zero Hour.
|
|
||
| Object *damageDealer = TheGameLogic->findObjectByID( damageInfo->in.m_sourceID ); | ||
|
|
||
| ObjectCreationList::create(getCreateObjectDieModuleData()->m_ocl, getObject(), damageDealer); |
There was a problem hiding this comment.
This is not a good change. I suggest to sync Generals to Zero Hour.
| // if this is an enemy object of the builder object (and therefore the thing | ||
| // that will be constructed) we can't build here | ||
| // | ||
| if( builderObject && builderObject->getRelationship( them ) == ENEMIES ) { |
There was a problem hiding this comment.
This is not a good change. I suggest to sync Generals to Zero Hour.
| // ------------------------------------------------------------------------------------------------ | ||
| void DockUpdate::loadDockPositions() | ||
| { | ||
| Drawable *myDrawable = getObject()->getDrawable(); |
There was a problem hiding this comment.
Unnecessary change. I suggest copy Generals to Zero Hour.
| int moneyAmount = modData->m_depositAmount; | ||
|
|
||
| getObject()->getControllingPlayer()->getMoney()->deposit( moneyAmount ); | ||
| getObject()->getControllingPlayer()->getScoreKeeper()->addMoneyEarned( modData->m_depositAmount); |
There was a problem hiding this comment.
Just note: Here the Zero Hour developer forgot refactor.
|
|
||
|
|
||
| setWakeFrame(getObject(), calcTimeToSleep()); | ||
| setWakeFrame(me, calcTimeToSleep()); |
There was a problem hiding this comment.
Just note: The Zero Hour developer forgot replacing a few getObject() above.
|
was this being worked on still? : ) |
split off #688