From 74b01416d0c612445729171a628b1a26d17aa343 Mon Sep 17 00:00:00 2001 From: terminx Date: Tue, 21 Jun 2016 00:32:33 +0000 Subject: [PATCH] Allow non-player hitscan projectiles to spawn sprites when impacting walls or sectors, and allow them to break sector textures (they could already break wall textures) git-svn-id: https://svn.eduke32.com/eduke32@5783 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/source/player.c | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/polymer/eduke32/source/player.c b/polymer/eduke32/source/player.c index 8f2bcbb76..a5fc5b514 100644 --- a/polymer/eduke32/source/player.c +++ b/polymer/eduke32/source/player.c @@ -760,7 +760,7 @@ SKIPBULLETHOLE: } // Finish shooting hitscan weapon from actor (sprite ). -static int32_t A_PostFireHitscan(const hitdata_t *hit, int32_t i, int32_t atwith, int32_t sa, int32_t extra, +static int32_t A_PostFireHitscan(const hitdata_t *hit, int32_t i, int32_t atwith, int32_t zvel, int32_t sa, int32_t extra, int32_t spawnatimpacttile, int32_t damagewalltile) { int32_t k = Proj_InsertShotspark(hit, i, atwith, 24, sa, extra); @@ -775,7 +775,19 @@ static int32_t A_PostFireHitscan(const hitdata_t *hit, int32_t i, int32_t atwith sprite[k].xrepeat = sprite[k].yrepeat = 0; } else if (hit->wall >= 0) + { A_DamageWall(k, hit->wall, &hit->pos, damagewalltile); + Proj_MaybeSpawn(k, spawnatimpacttile, hit); + } + else + { + if (Proj_MaybeDamageCF2(zvel, hit->sect)) + { + sprite[k].xrepeat = 0; + sprite[k].yrepeat = 0; + } + else Proj_MaybeSpawn(k, spawnatimpacttile, hit); + } return k; } @@ -929,8 +941,8 @@ static int32_t A_ShootCustom(const int32_t i, const int32_t atwith, int16_t sa, } else { - k = A_PostFireHitscan(&hit, i, atwith, sa, Proj_GetExtra(atwith), - atwith, atwith); + k = A_PostFireHitscan(&hit, i, atwith, zvel, sa, + Proj_GetExtra(atwith), atwith, atwith); } if ((krand() & 255) < 4 && proj->isound >= 0) @@ -1215,8 +1227,8 @@ static int32_t A_ShootHardcoded(int32_t i, int32_t atwith, int16_t sa, vec3_t sr } else { - k = A_PostFireHitscan(&hit, i, atwith, sa, G_InitialActorStrength(atwith), - -SMALLSMOKE, SHOTSPARK1); + k = A_PostFireHitscan(&hit, i, atwith, zvel, sa, + G_InitialActorStrength(atwith), -SMALLSMOKE, SHOTSPARK1); } if ((krand()&255) < 4)