From f24340f46a478ae87e73aebbf64fa3f7aa4acf1b Mon Sep 17 00:00:00 2001 From: Snu Date: Thu, 14 May 2020 03:13:00 +0100 Subject: [PATCH 1/3] add targets to MT_FASTLINEs spawned to tell what they're spawned from --- src/k_kart.c | 1 + src/p_enemy.c | 1 + 2 files changed, 2 insertions(+) diff --git a/src/k_kart.c b/src/k_kart.c index cc5504bb..02f34ce4 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -4486,6 +4486,7 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd) player->mo->y + (P_RandomRange(-36,36) * player->mo->scale), player->mo->z + (player->mo->height/2) + (P_RandomRange(-20,20) * player->mo->scale), MT_FASTLINE); + fast->target = player.mo; // makes it easier to link it back to afterwards fast->angle = R_PointToAngle2(0, 0, player->mo->momx, player->mo->momy); fast->momx = 3*player->mo->momx/4; fast->momy = 3*player->mo->momy/4; diff --git a/src/p_enemy.c b/src/p_enemy.c index a3bf5491..e34686be 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -8511,6 +8511,7 @@ void A_SPBChase(mobj_t *actor) actor->y + (P_RandomRange(-24,24) * actor->scale), actor->z + (actor->height/2) + (P_RandomRange(-24,24) * actor->scale), MT_FASTLINE); + fast->target = actor; // makes it easier to link it back to afterwards fast->angle = R_PointToAngle2(0, 0, actor->momx, actor->momy); //fast->momx = (3*actor->momx)/4; //fast->momy = (3*actor->momy)/4; From 3997c059885424974038caa87593c47399e7201d Mon Sep 17 00:00:00 2001 From: Snu Date: Thu, 14 May 2020 03:23:28 +0100 Subject: [PATCH 2/3] god damnit --- src/k_kart.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/k_kart.c b/src/k_kart.c index 02f34ce4..e90092a9 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -4486,7 +4486,7 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd) player->mo->y + (P_RandomRange(-36,36) * player->mo->scale), player->mo->z + (player->mo->height/2) + (P_RandomRange(-20,20) * player->mo->scale), MT_FASTLINE); - fast->target = player.mo; // makes it easier to link it back to afterwards + fast->target = player->mo; // makes it easier to link it back to afterwards fast->angle = R_PointToAngle2(0, 0, player->mo->momx, player->mo->momy); fast->momx = 3*player->mo->momx/4; fast->momy = 3*player->mo->momy/4; From 6b5eebe54a505e07525b3458d61fbba4d6489822 Mon Sep 17 00:00:00 2001 From: Snu Date: Thu, 14 May 2020 04:17:24 +0100 Subject: [PATCH 3/3] Use P_SetTarget instead of fast->target --- src/k_kart.c | 2 +- src/p_enemy.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index e90092a9..7ac35cd3 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -4486,11 +4486,11 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd) player->mo->y + (P_RandomRange(-36,36) * player->mo->scale), player->mo->z + (player->mo->height/2) + (P_RandomRange(-20,20) * player->mo->scale), MT_FASTLINE); - fast->target = player->mo; // makes it easier to link it back to afterwards fast->angle = R_PointToAngle2(0, 0, player->mo->momx, player->mo->momy); fast->momx = 3*player->mo->momx/4; fast->momy = 3*player->mo->momy/4; fast->momz = 3*player->mo->momz/4; + P_SetTarget(&fast->target, player->mo); // easier lua access K_MatchGenericExtraFlags(fast, player->mo); } diff --git a/src/p_enemy.c b/src/p_enemy.c index e34686be..2693c8cc 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -8511,13 +8511,13 @@ void A_SPBChase(mobj_t *actor) actor->y + (P_RandomRange(-24,24) * actor->scale), actor->z + (actor->height/2) + (P_RandomRange(-24,24) * actor->scale), MT_FASTLINE); - fast->target = actor; // makes it easier to link it back to afterwards fast->angle = R_PointToAngle2(0, 0, actor->momx, actor->momy); //fast->momx = (3*actor->momx)/4; //fast->momy = (3*actor->momy)/4; //fast->momz = (3*actor->momz)/4; fast->color = SKINCOLOR_RED; fast->colorized = true; + P_SetTarget(&fast->target, actor); // easier lua access K_MatchGenericExtraFlags(fast, actor); }