continuing to wail on poor dead mobs

Post Reply
User avatar
maxtherabbit
Developer
Posts: 57
Joined: Wed Jun 12, 2013 11:26 pm

continuing to wail on poor dead mobs

Post by maxtherabbit » Sun Dec 22, 2013 2:19 pm

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

User avatar
kjLotus
Special Guest
Posts: 1813
Joined: Sun Jul 22, 2012 2:16 pm

Re: continuing to wail on poor dead mobs

Post by kjLotus » Sun Dec 22, 2013 7:21 pm

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

Post Reply