From ddf453a170c53e05870000cd44827b5897404688 Mon Sep 17 00:00:00 2001 From: Time-Green Date: Mon, 12 Dec 2022 20:02:57 +0100 Subject: [PATCH] Removes ++ and -- in conditionals (#71925) --- code/game/objects/items/choice_beacon.dm | 3 ++- code/game/objects/items/pneumaticCannon.dm | 3 ++- code/game/objects/items/scrolls.dm | 3 ++- code/game/objects/structures/crates_lockers/closets.dm | 3 ++- code/modules/admin/callproc/callproc.dm | 3 ++- code/modules/admin/topic.dm | 3 ++- code/modules/admin/verbs/SDQL2/SDQL_2.dm | 3 ++- code/modules/antagonists/pirate/pirate.dm | 3 ++- code/modules/hallucination/battle.dm | 9 ++++++--- code/modules/hallucination/fake_sound.dm | 3 ++- code/modules/instruments/songs/_song.dm | 3 ++- .../mob/living/carbon/alien/special/alien_embryo.dm | 3 ++- .../modules/mob/living/simple_animal/heretic_monsters.dm | 3 ++- code/modules/mob/living/simple_animal/hostile/mimic.dm | 3 ++- code/modules/mob/living/simple_animal/parrot.dm | 3 ++- 15 files changed, 34 insertions(+), 17 deletions(-) diff --git a/code/game/objects/items/choice_beacon.dm b/code/game/objects/items/choice_beacon.dm index a3786945106..59f4e8a005f 100644 --- a/code/game/objects/items/choice_beacon.dm +++ b/code/game/objects/items/choice_beacon.dm @@ -52,7 +52,8 @@ \"Please stand by for a message from [company_source]. Message as follows: [company_message] Message ends.\"")) spawn_option(choice_path, user) - if(--uses <= 0) + uses-- + if(uses <= 0) do_sparks(3, source = src) qdel(src) return diff --git a/code/game/objects/items/pneumaticCannon.dm b/code/game/objects/items/pneumaticCannon.dm index b2b26110fc4..6c6c2ee8667 100644 --- a/code/game/objects/items/pneumaticCannon.dm +++ b/code/game/objects/items/pneumaticCannon.dm @@ -47,7 +47,8 @@ START_PROCESSING(SSobj, src) /obj/item/pneumatic_cannon/process() - if(++charge_tick >= charge_ticks && charge_type) + charge_tick++ + if(charge_tick >= charge_ticks && charge_type) fill_with_type(charge_type, charge_amount) /obj/item/pneumatic_cannon/Destroy() diff --git a/code/game/objects/items/scrolls.dm b/code/game/objects/items/scrolls.dm index d6b4567cd83..e6ceaf3ae0b 100644 --- a/code/game/objects/items/scrolls.dm +++ b/code/game/objects/items/scrolls.dm @@ -52,7 +52,8 @@ return if(!teleport.Activate(user)) return - if(--uses <= 0) + uses-- + if(uses <= 0) to_chat(user, span_warning("[src] runs out of uses and crumbles to dust!")) qdel(src) return TRUE diff --git a/code/game/objects/structures/crates_lockers/closets.dm b/code/game/objects/structures/crates_lockers/closets.dm index 9929ea51cf0..3afa18e9fd0 100644 --- a/code/game/objects/structures/crates_lockers/closets.dm +++ b/code/game/objects/structures/crates_lockers/closets.dm @@ -341,7 +341,8 @@ return FALSE var/mobs_stored = 0 for(var/mob/living/M in contents) - if(++mobs_stored >= mob_storage_capacity) + mobs_stored++ + if(mobs_stored >= mob_storage_capacity) return FALSE L.stop_pulling() diff --git a/code/modules/admin/callproc/callproc.dm b/code/modules/admin/callproc/callproc.dm index be7b0a770d9..25a2ee4a72c 100644 --- a/code/modules/admin/callproc/callproc.dm +++ b/code/modules/admin/callproc/callproc.dm @@ -208,7 +208,8 @@ GLOBAL_PROTECT(LastAdminCalledProc) GLOB.AdminProcCaller = user_identifier //if this runtimes, too bad for you ++GLOB.AdminProcCallCount . = world.WrapAdminProcCall(target, procname, arguments) - if(--GLOB.AdminProcCallCount == 0) + GLOB.AdminProcCallCount-- + if(GLOB.AdminProcCallCount == 0) GLOB.AdminProcCaller = null else . = world.WrapAdminProcCall(target, procname, arguments) diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm index 1c0a2007684..7fecefb40a1 100644 --- a/code/modules/admin/topic.dm +++ b/code/modules/admin/topic.dm @@ -793,7 +793,8 @@ var/iterable = 0 for(var/datum/antagonist/role in subject.mind.antag_datums) special_role_description += "[role.name]" - if(++iterable != length(subject.mind.antag_datums)) + iterable++ + if(iterable != length(subject.mind.antag_datums)) special_role_description += ", " special_role_description += "" else diff --git a/code/modules/admin/verbs/SDQL2/SDQL_2.dm b/code/modules/admin/verbs/SDQL2/SDQL_2.dm index 29d1d13e0a7..bd5a3ea7b33 100644 --- a/code/modules/admin/verbs/SDQL2/SDQL_2.dm +++ b/code/modules/admin/verbs/SDQL2/SDQL_2.dm @@ -785,7 +785,8 @@ GLOBAL_DATUM_INIT(sdql2_vv_statobj, /obj/effect/statclick/sdql2_vv_all, new(null if(v == "#null") SDQL_expression(d, set_list[sets]) break - if(++i == sets.len) + i++ + if(i == sets.len) if(superuser) if(temp.vars.Find(v)) temp.vars[v] = SDQL_expression(d, set_list[sets]) diff --git a/code/modules/antagonists/pirate/pirate.dm b/code/modules/antagonists/pirate/pirate.dm index d591c692f57..14aa971cdc2 100644 --- a/code/modules/antagonists/pirate/pirate.dm +++ b/code/modules/antagonists/pirate/pirate.dm @@ -88,7 +88,8 @@ var/count = 0 var/list/loot_texts = list() for(var/datum/export/E in cargo_hold.total_report.total_value) - if(++count > 5) + count++ + if(count > 5) break loot_texts += E.total_printout(cargo_hold.total_report,notes = FALSE) return loot_texts.Join(", ") diff --git a/code/modules/hallucination/battle.dm b/code/modules/hallucination/battle.dm index 6bcea2fe465..4bbf9729cde 100644 --- a/code/modules/hallucination/battle.dm +++ b/code/modules/hallucination/battle.dm @@ -47,7 +47,8 @@ qdel(src) // Or, if we do have shots left, keep it going. - else if(--shots_left > 0) + else if(shots_left >= 0) + shots_left-- addtimer(CALLBACK(src, PROC_REF(fire_loop), source, shots_left, hits), rand(CLICK_CD_RANGE, CLICK_CD_RANGE + 6)) // Otherwise, if we have no shots left, stop the hallucination. @@ -112,7 +113,8 @@ return hallucinator.playsound_local(source, SFX_SWING_HIT, 50, TRUE) - if(--hits_remaing <= 0) + hits_remaing-- + if(hits_remaing <= 0) qdel(src) else @@ -159,7 +161,8 @@ return hallucinator.playsound_local(source, 'sound/items/timer.ogg', 25, FALSE) - if(--ticks_remaining <= 0) + ticks_remaining-- + if(ticks_remaining <= 0) qdel(src) else diff --git a/code/modules/hallucination/fake_sound.dm b/code/modules/hallucination/fake_sound.dm index afcd01cb71f..700014d165d 100644 --- a/code/modules/hallucination/fake_sound.dm +++ b/code/modules/hallucination/fake_sound.dm @@ -98,7 +98,8 @@ play_fake_sound(mech_source) mech_dir = pick(GLOB.cardinals) - if(--steps_left <= 0) + steps_left-- + if(steps_left <= 0) qdel(src) else diff --git a/code/modules/instruments/songs/_song.dm b/code/modules/instruments/songs/_song.dm index cfa4af0bde4..ccd85ffda5f 100644 --- a/code/modules/instruments/songs/_song.dm +++ b/code/modules/instruments/songs/_song.dm @@ -250,7 +250,8 @@ stop_playing(FALSE) return var/list/chord = compiled_chords[current_chord] - if(++elapsed_delay < delay_by) + elapsed_delay++ + if(elapsed_delay < delay_by) return play_chord(chord) elapsed_delay = 0 diff --git a/code/modules/mob/living/carbon/alien/special/alien_embryo.dm b/code/modules/mob/living/carbon/alien/special/alien_embryo.dm index 6e3d01ed39d..90ec1a620ef 100644 --- a/code/modules/mob/living/carbon/alien/special/alien_embryo.dm +++ b/code/modules/mob/living/carbon/alien/special/alien_embryo.dm @@ -61,7 +61,8 @@ /obj/item/organ/internal/body_egg/alien_embryo/proc/advance_embryo_stage() if(stage >= 6) return - if(++stage < 6) + stage++ + if(stage < 6) INVOKE_ASYNC(src, PROC_REF(RefreshInfectionImage)) var/slowdown = 1 if(ishuman(owner)) diff --git a/code/modules/mob/living/simple_animal/heretic_monsters.dm b/code/modules/mob/living/simple_animal/heretic_monsters.dm index eb2fe92c4e6..efeea960f06 100644 --- a/code/modules/mob/living/simple_animal/heretic_monsters.dm +++ b/code/modules/mob/living/simple_animal/heretic_monsters.dm @@ -283,7 +283,8 @@ if(health < maxHealth * 0.8) return - if(++current_stacks < stacks_to_grow) + current_stacks++ + if(current_stacks < stacks_to_grow) return var/mob/living/simple_animal/hostile/heretic_summon/armsy/prev = new type(drop_location(), FALSE) diff --git a/code/modules/mob/living/simple_animal/hostile/mimic.dm b/code/modules/mob/living/simple_animal/hostile/mimic.dm index 633f6d7c23d..5693a2c305e 100644 --- a/code/modules/mob/living/simple_animal/hostile/mimic.dm +++ b/code/modules/mob/living/simple_animal/hostile/mimic.dm @@ -381,7 +381,8 @@ GLOBAL_LIST_INIT(mimic_blacklist, list(/obj/structure/table, /obj/structure/cabl return FALSE var/mobs_stored = 0 for(var/mob/living/M in contents) - if(++mobs_stored >= mob_storage_capacity) + mobs_stored++ + if(mobs_stored >= mob_storage_capacity) return FALSE L.stop_pulling() diff --git a/code/modules/mob/living/simple_animal/parrot.dm b/code/modules/mob/living/simple_animal/parrot.dm index 7d364aaf40e..84d204d8d7f 100644 --- a/code/modules/mob/living/simple_animal/parrot.dm +++ b/code/modules/mob/living/simple_animal/parrot.dm @@ -424,7 +424,8 @@ GLOBAL_LIST_INIT(strippable_parrot_items, create_strippable_list(list( icon_state = icon_living return - if(--parrot_sleep_dur) //Zzz + parrot_sleep_dur-- + if(parrot_sleep_dur) //Zzz return else