From: Jaka K. <lyn...@us...> - 2012-07-16 15:42:27
|
gemrb: Infinity Engine emulator The branch master has been updated via 1548377418bda1730ee1f673de4e07fa29da091e (commit) Summary of changes: gemrb/core/GameScript/GSUtils.cpp | 2 +- gemrb/core/Scriptable/Actor.cpp | 10 ++++++++-- gemrb/core/Scriptable/Actor.h | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) from 7ff4cad09ee59252220e31cdf64b0e09b65dcd83 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://gemrb.git.sourceforge.net/git/gitweb.cgi?p=gemrb/gemrb;a=commitdiff;h=1548377418bda1730ee1f673de4e07fa29da091e commit 1548377418bda1730ee1f673de4e07fa29da091e Author: Jaka Kranjc <lyn...@us...> Date: Mon Jul 16 17:36:20 2012 +0200 made ValidTarget take an optional Scriptable, so the GA_NO_HIDDEN check can account for actors with SEEINVISIBLE set, which is handy for CanSee diff --git a/gemrb/core/GameScript/GSUtils.cpp b/gemrb/core/GameScript/GSUtils.cpp index b4fffae..285a14a 100644 --- a/gemrb/core/GameScript/GSUtils.cpp +++ b/gemrb/core/GameScript/GSUtils.cpp @@ -512,7 +512,7 @@ int CanSee(Scriptable* Sender, Scriptable* target, bool range, int seeflag) if (target->Type==ST_ACTOR) { Actor *tar = (Actor *) target; - if (!tar->ValidTarget(seeflag)) { + if (!tar->ValidTarget(seeflag, Sender)) { return 0; } } diff --git a/gemrb/core/Scriptable/Actor.cpp b/gemrb/core/Scriptable/Actor.cpp index c869dad..8819ff5 100644 --- a/gemrb/core/Scriptable/Actor.cpp +++ b/gemrb/core/Scriptable/Actor.cpp @@ -4829,13 +4829,19 @@ void Actor::SetupQuickSlot(unsigned int which, int slot, int headerindex) core->SetEventFlag(EF_ACTION); } -bool Actor::ValidTarget(int ga_flags) const +bool Actor::ValidTarget(int ga_flags, Scriptable *checker) const { //scripts can still see this type of actor if (ga_flags&GA_NO_HIDDEN) { if (Modified[IE_AVATARREMOVAL]) return false; - if ((Modified[IE_EA]>EA_GOODCUTOFF) && (Modified[IE_STATE_ID] & state_invisible) ) { + + bool seer = false; + if (checker->Type == ST_ACTOR) { + seer = ((Actor *) checker)->GetSafeStat(IE_SEEINVISIBLE); + } + + if ((Modified[IE_EA]>EA_GOODCUTOFF) && (Modified[IE_STATE_ID] & state_invisible) && !seer) { return false; } } diff --git a/gemrb/core/Scriptable/Actor.h b/gemrb/core/Scriptable/Actor.h index 556b540..e85081a 100644 --- a/gemrb/core/Scriptable/Actor.h +++ b/gemrb/core/Scriptable/Actor.h @@ -425,7 +425,7 @@ public: /** returns a saving throw */ bool GetSavingThrow(ieDword type, int modifier); /** Returns true if the actor is targetable */ - bool ValidTarget(int ga_flags) const; + bool ValidTarget(int ga_flags, Scriptable *checker = NULL) const; /** Returns a Stat value */ ieDword GetStat(unsigned int StatIndex) const; /** Returns a safe Stat value, one, that is not partially computed */ ----------------------------------------------------------------------- This is an automated email from the git hooks/post-receive script. -- gemrb: Infinity Engine emulator |