diff --git a/_work/data/Scripts/Content/GFA/_intern/collision.d b/_work/data/Scripts/Content/GFA/_intern/collision.d index f7cb0df..f4c5906 100644 --- a/_work/data/Scripts/Content/GFA/_intern/collision.d +++ b/_work/data/Scripts/Content/GFA/_intern/collision.d @@ -216,7 +216,9 @@ func void GFA_CC_ProjectileCollisionWithNpc() { } else { // Retrieve the collision behavior based on the shooter, target and the material type of their armor var C_Npc target; target = _^(MEMINT_SwitchG1G2(EBX, MEM_ReadInt(/*esp+1ACh-190h*/ ESP+28))); + GFA_ProjectilePtr = MEM_ReadInt(arrowAI+oCAIArrowBase_hostVob_offset); // Temporarily provide projectile collision = GFA_CC_GetCollisionWithNpc_(shooter, target); + GFA_ProjectilePtr = 0; }; // Apply collision behavior @@ -359,7 +361,9 @@ func void GFA_CC_ProjectileCollisionWithWorld() { var int speed; speed = sqrtf(addf(addf(sqrf(vel[0]), sqrf(vel[1])), sqrf(vel[2]))); // Norm of vel // Retrieve the collision behavior based on the shooter, the material types and the textures of the collision object + GFA_ProjectilePtr = projectilePtr; // Temporarily provide projectile var int collision; collision = GFA_CC_GetCollisionWithWorld_(shooter, materials, textures); + GFA_ProjectilePtr = 0; const int DESTROY = 0; // Projectile breaks and vanishes const int STUCK = 1; // Projectile stays and is stuck in the surface of the collision object const int DEFLECT = 2; // Projectile deflects off of the surfaces and bounces off diff --git a/_work/data/Scripts/Content/GFA/_intern/const.d b/_work/data/Scripts/Content/GFA/_intern/const.d index 54e25d6..4e08ceb 100644 --- a/_work/data/Scripts/Content/GFA/_intern/const.d +++ b/_work/data/Scripts/Content/GFA/_intern/const.d @@ -131,6 +131,8 @@ const float GFA_SCATTER_MAX = 6.0; // (Visual angle)/2 var int GFA_CollTrj[6]; // Projectile trajectory of last collision candidate var string GFA_HitModelNode; // Name of model node that was hit +var int GFA_ProjectilePtr; // Pointer of currently colliding projectile (temporary) + const int DMG_NO_CHANGE = 0; // Do not adjust the damage const int DMG_DO_NOT_KNOCKOUT = 1; // Normal damage, shot may kill but never knockout (HP != 1) const int DMG_DO_NOT_KILL = 2; // Normal damage, shot may knockout but never kill (HP > 0)