Skip to content

Commit

Permalink
Fix los chase
Browse files Browse the repository at this point in the history
Closes #57

Signed-off-by: Cala <calaftp@free.fr>
  • Loading branch information
Laizerox authored and Cyberium committed Jul 23, 2016
1 parent 1c5d1c9 commit 88f7052
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/game/CreatureEventAI.cpp
Expand Up @@ -1371,11 +1371,18 @@ void CreatureEventAI::UpdateAI(const uint32 diff)
// Update creature dynamic movement position before doing anything else
if (m_DynamicMovement)
{
if (!m_creature->hasUnitState(UNIT_STAT_CAN_NOT_REACT) && !m_creature->IsNonMeleeSpellCasted(false))
if (!m_creature->hasUnitState(UNIT_STAT_CAN_NOT_REACT))
{
if (m_LastSpellMaxRange && m_creature->IsInRange(m_creature->getVictim(), 0, (m_LastSpellMaxRange / 1.5f)))
SetCombatMovement(false, true);
else
bool uiInLineOfSight = m_creature->IsWithinLOSInMap(m_creature->getVictim());

if (uiInLineOfSight && !m_creature->IsNonMeleeSpellCasted(false))
{
if (m_LastSpellMaxRange && m_creature->IsInRange(m_creature->getVictim(), 0, (m_LastSpellMaxRange / 1.5f)))
SetCombatMovement(false, true);
else
SetCombatMovement(true, true);
}
else if (!uiInLineOfSight)
SetCombatMovement(true, true);
}
}
Expand Down

7 comments on commit 88f7052

@cala
Copy link
Contributor

@cala cala commented on 88f7052 Jul 26, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was there a force push made with this commit?

@xfurry
Copy link
Member

@xfurry xfurry commented on 88f7052 Jul 26, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure, but I also noticed something strange with the git tree after the latest pull.

@killerwife
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prolly cyberium rebased main branch on top of PR branch instead of the other way around? :D

@cyberium
Copy link
Member

@cyberium cyberium commented on 88f7052 Jul 26, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry yes i did a mistake by rebasing last 4 commits instead of last 3 so i broked this commit for all of you who already pulled it.
Just put a command like

git reset --hard https://github.com/cmangos/mangos-wotlk.git

to fix it.

Btw i plan to do a big rebase for all repos to get rid of all accumulated merges commits.

@evil-at-wow
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like the merge commits either, but that big rebase idea sounds pretty dangerous because you'll be force pushing again... and this time in history that goes way back and who knows how many people have on their disks. I can't say I'm looking forward to that, to put it mildly.

@killerwife
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, I have a nice opinion about them. Merge commits are there for the dumbass to remember them to the end of his days, because he should be ashamed for doing them. At least thats the principle we have at vengeance :D
Funny trivia: days after @Laizerox started this rule, he made a merge commit.

Just food for thought. Its ugly, but we all need a reminder sometimes for our own incompetence.

@cyberium
Copy link
Member

@cyberium cyberium commented on 88f7052 Aug 2, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As i see some may not understaind what i meant here is more complete way of how to resolve this case
-> http://cmangos.net/thread-7537-post-46442.html#pid46442

basicaly following command always do the trick.

git reset --hard origin/master

Just make sure "origin" refer for you to

https://github.com/cmangos/mangos-wotlk.git

You can get/verify this by using

git remote -v
$ git remote -v
myrepo  git://github.com/cyberium/mangos-wotlk.git (fetch)
myrepo  git@github.com:cyberium/mangos-wotlk.git (push)
origin  git://github.com/cmangos/mangos-wotlk.git (fetch)
origin  git@github.com:cmangos/mangos-wotlk.git (push)

its a good practice to keep origin as source of the repository :)

btw sorry for this mistake

Please sign in to comment.