Page 1 of 1

continuing to wail on poor dead mobs

Posted: Sun Dec 22, 2013 2:19 pm
by maxtherabbit
was looking at link's changes to the ai_char_normal and I saw something (that was there already) that didn't look right

Code: Select all

			/////////////////////////////////////////////////////////////////////////
			//	Start of the attack loop.
			/////////////////////////////////////////////////////////////////////////
			for (uint8 i = 0; i < attackRound->GetAttackSwingCount(); ++i)
			{
				apAction_t Action;
				Action.ActionTarget = m_PBattleTarget;
				Action.knockback  = 0;  

				// Reference to the current swing.
				CAttack* attack = (CAttack*)attackRound->GetCurrentAttack();

				if (i != 0)
				{
					if (m_PBattleTarget->isDead())
					{
						break;
					}
					Action.ActionTarget = NULL;
				}
the logic to stop swinging on dead mobs has never worked... the code I've quoted here seems to try to implement it, but breaking the for loop is not getting it done, and setting the ActionTarget to NULL everytime if i != 0 really doesn't make sense

Re: continuing to wail on poor dead mobs

Posted: Sun Dec 22, 2013 7:21 pm
by kjLotus
maxtherabbit wrote:and setting the ActionTarget to NULL everytime if i != 0 really doesn't make sense
it's done because the action packet doesn't send the target ID again on multiple attacks, it only needs that for aoes that hit multiple targets (and the action packet uses the actiontarget to being null to determine whether or not to do that)

as for the rest, i didn't even know there was code that was supposed to break the loop (i also knew it didn't), haven't looked at why it doesn't work though