spawn attacks are skill based, not command based

Units have to spawn without a command too ( like buildings )
This commit is contained in:
titiger 2021-02-26 01:49:31 +01:00
parent 3b52832bb0
commit b20002e7dc
1 changed files with 4 additions and 13 deletions

View File

@ -290,19 +290,10 @@ bool UnitUpdater::updateUnit(Unit *unit) {
// !!! Is this causing choppy network play somehow?
//unit->computeHp();
}
else if(unit->getCommandSize() > 0) {
Command *command= unit->getCurrCommand();
if(command != NULL) {
const AttackCommandType *act= dynamic_cast<const AttackCommandType*>(command->getCommandType());
if (act != NULL && act->getAttackSkillType() != NULL
&& act->getAttackSkillType()->getSpawnUnit() != ""
&& act->getAttackSkillType()->getSpawnUnitCount() > 0) {
spawnAttack(unit, act->getAttackSkillType()->getSpawnUnit(),
act->getAttackSkillType()->getSpawnUnitCount(), 100,
100, 100,
act->getAttackSkillType()->getSpawnUnitAtTarget());
}
else if (unit->getCurrSkill() != NULL && unit->getCurrSkill()->getClass() == scAttack) {
const AttackSkillType *attackSkill = dynamic_cast<const AttackSkillType*>(unit->getCurrSkill());
if (attackSkill != NULL && attackSkill->getSpawnUnit() != "" && attackSkill->getSpawnUnitCount() > 0) {
spawnAttack(unit, attackSkill->getSpawnUnit(), attackSkill->getSpawnUnitCount(), 100, 100, 100, attackSkill->getSpawnUnitAtTarget());
}
}