Permalink
Browse files

treat IE_AVATARREMOVAL as being unscheduled instead of just invisible

This fixes cases where two actors share the same location on the map with
one of them having the avatar removed. If the removed actor was found
earlier in the list of actors it would be impossible to talk to or
otherwise interact with the present actor (e.g. IWD AR9101).
  • Loading branch information...
1 parent d5c9f15 commit 8169691cb0980d4f9cbad96018c4d9ba1c489fa2 @fizzet fizzet committed Jun 22, 2013
Showing with 7 additions and 8 deletions.
  1. +7 −8 gemrb/core/Scriptable/Actor.cpp
@@ -5218,6 +5218,8 @@ bool Actor::ValidTarget(int ga_flags, Scriptable *checker) const
//scripts can still see this type of actor
if (ga_flags&GA_NO_UNSCHEDULED) {
+ if (Modified[IE_AVATARREMOVAL]) return false;
+
Game *game = core->GetGame();
if (game) {
if (!Schedule(game->GameTime, true)) return false;
@@ -7195,6 +7197,11 @@ void Actor::Draw(const Region &screen)
return;
}
+ //iwd has this flag saved in the creature
+ if (Modified[IE_AVATARREMOVAL]) {
+ return;
+ }
+
//visual feedback
CharAnimations* ca = GetAnims();
if (!ca) {
@@ -7209,11 +7216,6 @@ void Actor::Draw(const Region &screen)
Trans=255;
}
- //iwd has this flag saved in the creature
- if (Modified[IE_AVATARREMOVAL]) {
- Trans = 255;
- }
-
int State = Modified[IE_STATE_ID];
//adjust invisibility for enemies
@@ -9542,11 +9544,8 @@ int Actor::GetArmorFailure(int &armor, int &shield) const
}
// checks whether the actor is visible to another scriptable
-// if flags is 1, it skips the EA check for STATE_INVISIBLE
bool Actor::IsInvisibleTo(Scriptable *checker) const
{
- if (Modified[IE_AVATARREMOVAL]) return true;
-
bool canSeeInvisibles = false;
if (checker && checker->Type == ST_ACTOR) {
canSeeInvisibles = ((Actor *) checker)->GetSafeStat(IE_SEEINVISIBLE);

0 comments on commit 8169691

Please sign in to comment.