Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code Readability - Turret Control #18165

Merged

Conversation

KalevTait
Copy link
Contributor

What Does This PR Do

Replaces several calls to pick(0,1) with calls to prob(50) within /obj/machinery/turretid/emp_act(severity), as well as one case that is the same idea but worse.

Why It's Good For The Game

More readable code is easier to work with.

@ParadiseSS13-Bot ParadiseSS13-Bot added the -Status: Awaiting type assignment This PR is waiting for its type to be assigned internally label Jun 30, 2022
@AffectedArc07 AffectedArc07 added Refactor This PR will clean up the code but have the same ingame outcome GBP: No Update labels Jun 30, 2022
@ParadiseSS13-Bot ParadiseSS13-Bot added -Status: Awaiting review This PR is awaiting review from the review team and removed -Status: Awaiting type assignment This PR is waiting for its type to be assigned internally labels Jun 30, 2022
@ParadiseSS13-Bot ParadiseSS13-Bot added -Status: Awaiting merge This PR is ready for merge and removed -Status: Awaiting review This PR is awaiting review from the review team labels Jul 1, 2022
@SteelSlayer SteelSlayer merged commit f18bf0f into ParadiseSS13:master Jul 1, 2022
@KalevTait KalevTait deleted the cleanup_turret_control_new branch July 1, 2022 23:10
AffectedArc07 pushed a commit that referenced this pull request Jul 9, 2022
* okay

* removes unnecessary changes

* also fixes vent crawling through trinary devices

* Squashed commit of the following:

commit 69fb7ad
Author: Kugamo <thekugamo@gmail.com>
Date:   Mon Jul 4 21:02:30 2022 -0500

    blah

commit ad608c8
Author: KalevTait <107985691+KalevTait@users.noreply.github.com>
Date:   Mon Jul 4 16:41:18 2022 +0100

    atmospherics (#18152)

commit c644fd0
Author: Viz <107632879+Inadvizable@users.noreply.github.com>
Date:   Mon Jul 4 09:28:22 2022 +0200

    I HATE INSTANT STUNS! I HATE INSTANT STUNS! (#18196)

commit 422f40b
Author: Farie82 <farie82@users.noreply.github.com>
Date:   Sun Jul 3 23:28:19 2022 +0200

    Makes it so the baseturf on lavaland is lava, not space (#18193)

commit 77767b8
Author: Viz <107632879+Inadvizable@users.noreply.github.com>
Date:   Sun Jul 3 23:12:44 2022 +0200

    Untases your slug (#18185)

commit 38c4d55
Author: Vi3trice <80771500+Vi3trice@users.noreply.github.com>
Date:   Sun Jul 3 15:51:30 2022 -0400

    Operative nuke spawns in the right place (#18199)

    * Ah yes, nukes

    * Oh that works too.

    * Update nuclear.dm

commit 9a86471
Author: Charlie <69320440+hal9000PR@users.noreply.github.com>
Date:   Sun Jul 3 20:51:21 2022 +0100

    buckling (#18203)

commit 3613019
Author: KalevTait <107985691+KalevTait@users.noreply.github.com>
Date:   Sun Jul 3 18:55:11 2022 +0100

    Code Readability - Pipe Dispenser (#18169)

    * pipe_dispenser

    * prrefer wrench_act for wrench use

    * Use User, Not Usr

    Co-authored-by: Sirryan2002 <80364400+Sirryan2002@users.noreply.github.com>

    * Apply suggestions from code review

    Co-authored-by: Charlie <69320440+hal9000PR@users.noreply.github.com>

    Co-authored-by: Sirryan2002 <80364400+Sirryan2002@users.noreply.github.com>
    Co-authored-by: Charlie <69320440+hal9000PR@users.noreply.github.com>

commit da94f63
Author: GDN <96800819+GDNgit@users.noreply.github.com>
Date:   Sun Jul 3 07:25:09 2022 -0500

    Nerfs telekinesis (#18177)

    * tk nerfed from .3 to 3 seconds

    * Update telekinesis.dm

    * removes those (), I didn't need em

commit bfdce29
Author: PacifistDalek <32213277+PacifistDalek@users.noreply.github.com>
Date:   Sun Jul 3 07:09:57 2022 -0400

    Absolute Heresy (#18182)

commit 41b231a
Author: Contrabang <91113370+Contrabang@users.noreply.github.com>
Date:   Sun Jul 3 04:08:35 2022 -0700

    update config comments to be accurate (#18175)

commit e3b5527
Author: moxian <moxian@users.noreply.github.com>
Date:   Sat Jul 2 22:38:01 2022 +0000

    Fix several runtimes with remote welderbombing (#18137)

commit 9a8d6da
Author: Kugamo <thekugamo@gmail.com>
Date:   Sat Jul 2 12:45:24 2022 -0500

    New TEG sprites (#18085)

    * amogus

    * Revert "amogus"

    This reverts commit ebaa99c.

    * T E Gee

    :D

    * adjusts sprites slightly

    TEGs taller now, I though they looked too short b4

    * makes pipe connection nicer

    * Emissive Devices

    yep

    * suggested changes

    Moved update_icon() call out of atmos/process, which was calling it multiple times a second, and into return_transfer_air() which is the only place where the critical variable is redefined.

    * readds conflicted changes

    * bruh

    * SteelSlayer Suggestion

    Co-authored-by: SteelSlayer <42044220+SteelSlayer@users.noreply.github.com>

    * removes duplicate proc

    Co-authored-by: SteelSlayer <42044220+SteelSlayer@users.noreply.github.com>

commit 8dc53fc
Author: KalevTait <107985691+KalevTait@users.noreply.github.com>
Date:   Sat Jul 2 17:34:38 2022 +0100

    Code Readability - Doors (#18149)

    * doors

    * return TRUE

    Co-authored-by: Sirryan2002 <80364400+Sirryan2002@users.noreply.github.com>

    * return TRUE

    Co-authored-by: Sirryan2002 <80364400+Sirryan2002@users.noreply.github.com>

    * return TRUE

    Co-authored-by: Sirryan2002 <80364400+Sirryan2002@users.noreply.github.com>

    Co-authored-by: Sirryan2002 <80364400+Sirryan2002@users.noreply.github.com>

commit 89ba9c0
Author: KalevTait <107985691+KalevTait@users.noreply.github.com>
Date:   Sat Jul 2 16:48:46 2022 +0100

    Code Readability - Effects (#18150)

    * effects

    * removed anchored = TRUE from objects that inherit that property within the effects folder and subfolders

commit 3c00a1f
Author: AffectedArc07 <25063394+AffectedArc07@users.noreply.github.com>
Date:   Fri Jul 1 23:25:01 2022 +0100

    Removes cortical borers. No, I am not sorry. (#18161)

    * Removes cortical borers. No, I am not sorry.

    * Icon purge

commit 26bd519
Author: Kugamo <thekugamo@gmail.com>
Date:   Fri Jul 1 17:20:42 2022 -0500

    [GBP no update] Fixes Possible Firealarm spam (#18143)

    * Yep

    * SteelSlayer Suggestion

    Co-authored-by: SteelSlayer <42044220+SteelSlayer@users.noreply.github.com>

    Co-authored-by: SteelSlayer <42044220+SteelSlayer@users.noreply.github.com>

commit f664644
Author: KalevTait <107985691+KalevTait@users.noreply.github.com>
Date:   Fri Jul 1 23:02:55 2022 +0100

    Code Readability - Computers (#18147)

    * computers

    * Remove src.

    Co-authored-by: Sirryan2002 <80364400+Sirryan2002@users.noreply.github.com>

    * remove src.

    Co-authored-by: Sirryan2002 <80364400+Sirryan2002@users.noreply.github.com>

    * change var name 'screen' to 'authenticated'

    Co-authored-by: Sirryan2002 <80364400+Sirryan2002@users.noreply.github.com>

commit d1da076
Author: KalevTait <107985691+KalevTait@users.noreply.github.com>
Date:   Fri Jul 1 21:52:12 2022 +0100

    Code Readability - Spells  (#18141)

    * changed fake disintegrate to not need a permit (as far as sec bots are concerned)

    * prefer boolean defines to magic numbers

    Co-authored-by: AffectedArc07 <25063394+AffectedArc07@users.noreply.github.com>

    * added check

    * spells

    * Revert "added check"

    This reverts commit 082aa40.

    Co-authored-by: AffectedArc07 <25063394+AffectedArc07@users.noreply.github.com>

commit 8b87691
Author: Marm <85680653+ItsMarmite@users.noreply.github.com>
Date:   Fri Jul 1 15:42:29 2022 +0100

    Fixes ebolas (#18168)

commit aaf1eae
Author: moxian <moxian@users.noreply.github.com>
Date:   Fri Jul 1 14:42:11 2022 +0000

    Fix a runtime in dna vault Initialize (#18172)

commit 66cad5f
Author: KalevTait <107985691+KalevTait@users.noreply.github.com>
Date:   Fri Jul 1 10:26:55 2022 +0100

    Code Readability - Door Control (#18162)

    * door_control

    * put comment back

    * comment change for autodoc

    Co-authored-by: Charlie <69320440+hal9000PR@users.noreply.github.com>

    Co-authored-by: Charlie <69320440+hal9000PR@users.noreply.github.com>

commit f18bf0f
Author: KalevTait <107985691+KalevTait@users.noreply.github.com>
Date:   Fri Jul 1 06:06:40 2022 +0100

    turret_control (#18165)

commit 46b5b16
Author: S34N <12197162+S34NW@users.noreply.github.com>
Date:   Thu Jun 30 22:32:34 2022 +0100

    updated holopad (#18145)

commit e9133fe
Author: KalevTait <107985691+KalevTait@users.noreply.github.com>
Date:   Thu Jun 30 22:32:13 2022 +0100

    toilet init (#18146)

commit 51f8705
Author: Marm <85680653+ItsMarmite@users.noreply.github.com>
Date:   Thu Jun 30 19:00:29 2022 +0100

    Nerfs Deathnettle (#18128)

    * Nerfs Deathnettle (I hate plants)

    * Update nettle.dm

    Early returns are good apparently.

    * Stage of grief: fear

    Should fix errors?

    * Update code/modules/hydroponics/grown/nettle.dm

    Co-authored-by: AffectedArc07 <25063394+AffectedArc07@users.noreply.github.com>

    Co-authored-by: AffectedArc07 <25063394+AffectedArc07@users.noreply.github.com>

commit bead47e
Author: Charlie <69320440+hal9000PR@users.noreply.github.com>
Date:   Thu Jun 30 17:57:52 2022 +0100

    Adds crawling. (#17899)

    * crawling?

    * knockdown. CONTAINS CHANGES THAT NEED REVERTING

    * plotting can_moves death

    * CANMOVE IS DEAD

    * mappers are insane

    * removes todos as the are todone

    * decreases crawling speed

    * silly-con fixes

    * surgery fixes

    * fixes death

    * pAI fixes

    * removes var/lying

    * runtime fix

    * decreases default crawling speed

    * correct crawling dir

    * some more fixes

    * stunbaton tweak, revert later

    * rejuv fix

    * restraint and incapacitated refactor

    * crawling dir in line with TG

    * fixes vehicle movement and grabs

    * alien rest fixes

    * antistun fixes

    * fixed fall sounds

    * forgor to stage this

    * first review

    * canmove zombie dispersal

    * fix

    * lots of fixes

    * defines

    * fixes the trait helper

    * if you got no legs you can still crawl

    * sillyconfix

    * no reverty keepy

    * jaunt fix

    * hopefully fixes perma sleepy zzz

    * admin rejuv temp fix

    * rest canceling

    * antistun chems now remove knockdown

    * buckle offset fix

    * fixes some stuff

    * crawling delay = 4

    * descuffs bed

    * sleeping hotfix

    * fixes simple mob resting

    * V is the macro for resting

    * projectiles no dodgy

    * refines the projectile check

    * god I hate strings

    * MORE FIXES

    * I hate buckling

    * fixes capulettium plus

    * winding down

    * farie review

    * bugs did stop showing up

    * SEAN

    * todo

    * sean review

    * ed209

    * i HATE cyborgs

    * steel review

    * laaaaaast things

    * reverts stun baton changes

    * and done

* Revert "Squashed commit of the following:"

This reverts commit 734c903.

* new solution!!

actually utilizes the logic in /obj/machinery/atmospherics/relaymove(mob/living/user, direction) that seemingly was written for just these scenarios (moving between pipenets)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
-Status: Awaiting merge This PR is ready for merge Refactor This PR will clean up the code but have the same ingame outcome
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants