Permalink
Browse files

Animation warheads should follow AffectsAllies/Enemies, where either …

…the owning unit/house is set in the animation.

This happens for sure in AttachEffects, considering that WW just pushed a simple 0 there, I wouldn't be surprised if nothing else is changed.
  • Loading branch information...
GraionDilach committed Feb 19, 2012
1 parent 7fca961 commit 946897ccdd524c3a63531878c557378f23392797
Showing with 26 additions and 7 deletions.
  1. +4 −4 src/Ares.version.h
  2. +22 −3 src/Misc/Bugfixes.cpp
View
@@ -1,9 +1,9 @@
#ifndef VERSION_H
#define VERSION_H
-#define VERSION_MAJOR 0
-#define VERSION_MINOR 1
-#define VERSION_REVISION 1176
+#define VERSION_MAJOR 12
+#define VERSION_MINOR 50
+#define VERSION_REVISION 948
#define SAVEGAME_MAGIC ((VERSION_MAJOR << 24) | (VERSION_MINOR << 16) | (VERSION_REVISION))
@@ -28,6 +28,6 @@
// "1.001/Ares $ver"
#define VERSION_STRMINI "1.001/Ares " VERSION_STR
-#define VERSION_INTERNAL "Ares r" str(VERSION_REVISION)
+#define VERSION_INTERNAL "Ares r" VERSION_STR
#endif
View
@@ -236,14 +236,32 @@ DEFINE_HOOK_AGAIN(42463A, AnimClass_Update_Damage, 6)
? RulesClass::Global()->FlameDamage2
: RulesClass::Global()->C4Warhead;
}
- DWORD WH = (DWORD)W;
DWORD origin = R->get_Origin();
if(origin == 0x42461D) {
- R->ECX(WH);
+ R->ECX(W);
} else {
- R->EDX(WH);
+ R->EDX(W);
}
+
+ if (Anim->Owner) {
+ R->Stack<HouseClass *>(0x4, Anim->Owner);
+ } else {
+ if (Anim->OwnerObject) {
+ if (TechnoClass* OwnerObject = generic_cast<TechnoClass *>(Anim->OwnerObject)) {
+ R->Stack<HouseClass *>(0x4, OwnerObject->Owner);
+ //Debug::Log("Info: %s has ownerhouse set to %s.\n",
+ //Anim->Type->ID, OwnerObject->Owner->Type->ID);
+ }
+#ifdef DEBUGBUILD
+ } else {
+ Debug::Log("Info: Ownerless instance of %s.",
+ Anim->Type->ID);
+#endif
+
+ }
+ }
+
return 0; // WHAT? origin + 6;
}
@@ -1006,3 +1024,4 @@ DEFINE_HOOK(4D9F7B, FootClass_Sell_Detonate, 6)
}
return 0;
}
+

0 comments on commit 946897c

Please sign in to comment.