Skip to content
Browse files

added ignorant version of iwd2's SetMyTarget

separation of last target and last spell target is in the works
  • Loading branch information...
1 parent 26e9afb commit 059a982e6af52f890aa4d223767f89d71daa3b69 @lynxlynxlynx lynxlynxlynx committed Aug 9, 2013
Showing with 16 additions and 0 deletions.
  1. +14 −0 gemrb/core/GameScript/Actions.cpp
  2. +1 −0 gemrb/core/GameScript/GameScript.cpp
  3. +1 −0 gemrb/core/GameScript/GameScript.h
View
14 gemrb/core/GameScript/Actions.cpp
@@ -2091,6 +2091,20 @@ void GameScript::WaitAnimation(Scriptable* Sender, Action* parameters)
}
}
+// the spell target and attack target are different only in iwd2
+void GameScript::SetMyTarget(Scriptable* Sender, Action* parameters)
+{
+ Actor *actor = (Actor *) Sender;
+ Scriptable *tar = GetActorFromObject(Sender, parameters->objects[1]);
+ actor->LastTargetPos.empty();
+ if (!tar) {
+ // we got called with Nothing to invalidate the target
+ actor->LastTarget = 0;
+ return;
+ }
+ actor->LastTarget = tar->GetGlobalID();
+}
+
// PlaySequence without object parameter defaults to Sender
void GameScript::PlaySequence(Scriptable* Sender, Action* parameters)
{
View
1 gemrb/core/GameScript/GameScript.cpp
@@ -849,6 +849,7 @@ static const ActionLink actionnames[] = {
{"setmazeharder", GameScript::SetMazeHarder, 0}, //pst specific crap
{"setmoraleai", GameScript::SetMoraleAI, 0},
{"setmusic", GameScript::SetMusic, 0},
+ {"setmytarget", GameScript::SetMyTarget, 0},
{"setname", GameScript::SetApparentName, 0},
{"setnamelessclass", GameScript::SetNamelessClass, 0},
{"setnamelessdeath", GameScript::SetNamelessDeath, 0},
View
1 gemrb/core/GameScript/GameScript.h
@@ -1306,6 +1306,7 @@ class GEM_EXPORT GameScript {
static void SetMazeHarder(Scriptable* Sender, Action* parameters);
static void SetMoraleAI(Scriptable* Sender, Action* parameters);
static void SetMusic(Scriptable* Sender, Action* parameters);
+ static void SetMyTarget(Scriptable* Sender, Action* parameters);
static void SetNamelessClass(Scriptable* Sender, Action* parameters);
static void SetNamelessDeath(Scriptable* Sender, Action* parameters);
static void SetNamelessDisguise(Scriptable* Sender, Action* parameters);

0 comments on commit 059a982

Please sign in to comment.
Something went wrong with that request. Please try again.