From 48e8d150421d97d513752713b62d19c5b6c2b284 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Fri, 25 Dec 2020 00:04:05 +0100 Subject: [PATCH] refactored toggle_radius as a separate function --- mapeffects.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/mapeffects.cpp b/mapeffects.cpp index de2f9c53..8bb9c503 100644 --- a/mapeffects.cpp +++ b/mapeffects.cpp @@ -791,13 +791,17 @@ EX void toggleGates(cell *c, eWall type, int rad) { } } +EX int toggle_radius(eWall type) { + if(type == waClosePlate && PURE) + return 2; + else + return (GOLDBERG && !sphere && !a4) ? gp::dist_3() : 3; + } + EX void toggleGates(cell *ct, eWall type) { playSound(ct, "click"); numgates = 0; - if(type == waClosePlate && PURE) - toggleGates(ct, type, 2); - else - toggleGates(ct, type, (GOLDBERG && !sphere && !a4) ? gp::dist_3() : 3); + toggleGates(ct, type, toggle_radius(type)); if(numgates && type == waClosePlate) playSound(ct, "closegate"); if(numgates && type == waOpenPlate)