Add attacker parameter to PlayHitsound
authorMario <mario@smbclan.net>
Sun, 21 Aug 2016 06:19:11 +0000 (16:19 +1000)
committerMario <mario@smbclan.net>
Sun, 21 Aug 2016 06:19:11 +0000 (16:19 +1000)
qcsrc/common/turrets/turret/fusionreactor.qc
qcsrc/server/g_damage.qc
qcsrc/server/mutators/events.qh
qcsrc/server/steerlib.qc
qcsrc/server/steerlib.qh

index cd7dbec..47bff24 100644 (file)
@@ -8,7 +8,7 @@ CLASS(FusionReactor, Turret)
 /* modelname  */ ATTRIB(FusionReactor, mdl, string, "base.md3");
 /* model      */ ATTRIB_STRZONE(FusionReactor, model, string, strcat("models/turrets/", this.mdl));
 /* head_model */ ATTRIB_STRZONE(FusionReactor, head_model, string, strcat("models/turrets/", "reactor.md3"));
-/* netname    */ ATTRIB(FusionReactor, netname, string, "fusionreactor");
+/* netname    */ ATTRIB(FusionReactor, netname, string, "fusreac");
 /* fullname   */ ATTRIB(FusionReactor, turret_name, string, _("Fusion Reactor"));
 ENDCLASS(FusionReactor)
 REGISTER_TURRET(FUSIONREACTOR, NEW(FusionReactor));
index d7e9b07..7290475 100644 (file)
@@ -788,7 +788,7 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, int d
                        else
                                victim = targ;
 
-                       if(IS_PLAYER(victim) || (IS_TURRET(victim) && victim.active == ACTIVE_ACTIVE) || IS_MONSTER(victim) || MUTATOR_CALLHOOK(PlayHitsound, victim))
+                       if(IS_PLAYER(victim) || (IS_TURRET(victim) && victim.active == ACTIVE_ACTIVE) || IS_MONSTER(victim) || MUTATOR_CALLHOOK(PlayHitsound, victim, attacker))
                        {
                                if(DIFF_TEAM(victim, attacker) && !STAT(FROZEN, victim))
                                {
index 1c09857..83d39f8 100644 (file)
@@ -58,6 +58,7 @@ MUTATOR_HOOKABLE(PlayerDies, EV_PlayerDies);
 /** called when a player dies to e.g. remove stuff he was carrying */
 #define EV_PlayHitsound(i, o) \
     /** victim */ i(entity, MUTATOR_ARGV_0_entity) \
+    /** attacker */ i(entity, MUTATOR_ARGV_1_entity) \
     /**/
 MUTATOR_HOOKABLE(PlayHitsound, EV_PlayHitsound);
 
index c69230d..5312eb8 100644 (file)
@@ -7,10 +7,11 @@
 /**
     Uniform pull towards a point
 **/
-vector steerlib_pull(entity this, vector point)
+#define steerlib_pull(ent,point) normalize(point - (ent).origin)
+/*vector steerlib_pull(entity this, vector point)
 {
     return normalize(point - this.origin);
-}
+}*/
 
 /**
     Uniform push from a point
index fa21610..4beb69f 100644 (file)
@@ -4,4 +4,4 @@
 
 vector steerlib_arrive(entity this, vector point, float maximal_distance);
 vector steerlib_attract2(entity this, vector point, float min_influense, float max_distance, float max_influense);
-vector steerlib_pull(entity this, vector point);
+//vector steerlib_pull(entity this, vector point);