From 6c2ef839c1cf3b6aca7797d76a73e09c273b907b Mon Sep 17 00:00:00 2001 From: Steel Titanium Date: Thu, 18 Jul 2019 22:42:46 -0400 Subject: [PATCH 1/3] New award rings linedef executor --- src/p_spec.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/p_spec.c b/src/p_spec.c index 3cd0461e2..48079b9e5 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -3916,6 +3916,21 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec) F_StartTextPrompt(promptnum, pagenum, mo, runpostexec ? postexectag : 0, blockcontrols, freezerealtime); } } + case 460: // Award rings + { + INT16 rings = (sides[line->sidenum[0]].textureoffset>>FRACBITS); + INT16 delay = (sides[line->sidenum[0]].rowoffset>>FRACBITS); + if (mo && mo->player) + { + if (delay > 0) + { + if (!(leveltime % (delay*TICRATE))) + P_GivePlayerRings(mo->player, rings); + } + else + P_GivePlayerRings(mo->player, rings); + } + } break; #ifdef POLYOBJECTS From 60ffef9830f82b4ac948e13e504da7d4906cc9c0 Mon Sep 17 00:00:00 2001 From: Steel Titanium Date: Wed, 24 Jul 2019 21:18:07 -0400 Subject: [PATCH 2/3] More simplified code Also delay is in tics, per MS' request. --- src/p_spec.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/p_spec.c b/src/p_spec.c index 48079b9e5..f712f4b23 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -3917,20 +3917,15 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec) } } case 460: // Award rings - { - INT16 rings = (sides[line->sidenum[0]].textureoffset>>FRACBITS); - INT16 delay = (sides[line->sidenum[0]].rowoffset>>FRACBITS); - if (mo && mo->player) { - if (delay > 0) + INT16 rings = (sides[line->sidenum[0]].textureoffset>>FRACBITS); + tic_t delay = (sides[line->sidenum[0]].rowoffset>>FRACBITS); + if (mo && mo->player) { - if (!(leveltime % (delay*TICRATE))) + if (delay <= 0 || !(leveltime % (delay))) P_GivePlayerRings(mo->player, rings); } - else - P_GivePlayerRings(mo->player, rings); } - } break; #ifdef POLYOBJECTS From f3baac85770e26b3b5efd3b3294422c9a250d3cc Mon Sep 17 00:00:00 2001 From: toaster Date: Sat, 3 Aug 2019 08:04:02 -0400 Subject: [PATCH 3/3] Fix the minor issues since steel's busy --- src/p_spec.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/p_spec.c b/src/p_spec.c index f712f4b23..f6c0be083 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -3916,13 +3916,15 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec) F_StartTextPrompt(promptnum, pagenum, mo, runpostexec ? postexectag : 0, blockcontrols, freezerealtime); } } + break; + case 460: // Award rings { INT16 rings = (sides[line->sidenum[0]].textureoffset>>FRACBITS); - tic_t delay = (sides[line->sidenum[0]].rowoffset>>FRACBITS); + INT32 delay = (sides[line->sidenum[0]].rowoffset>>FRACBITS); if (mo && mo->player) { - if (delay <= 0 || !(leveltime % (delay))) + if (delay <= 0 || !(leveltime % delay)) P_GivePlayerRings(mo->player, rings); } }