* Replacing more C-style for loops with the faster, traditional ones. (#62908)
* Replacing more C-style for loops with the faster, traditional ones.
Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com>
* [MDB IGNORE] dir sanity, primarily on WALLITEMs (#62601)
About The Pull Request
Wall items mostly use the direction from the floor to the wall in the named mapping helper. Wall items mostly use the direction from the wall to the floor for the internal dir variable.
This leads to a headache when it comes to working out what conflicts with what, and what needs placing where.
Wall frames provided a member, inverse, which specified whether or not to invert the direction of the item when looking for conflicts. It was also used to specify whether to look for conflicts outside of the wall (cameras and lights appear external to the wall) or inside the wall (most wall items). This flag was set for Intercoms, APCs, and Lights. Since APCs and Lights expect a floor-to-wall direction, and Intercoms expect a wall-to-floor direction, this means that APCs and Lights were getting the correct direction, and Intercoms were getting the wrong direction.
Some implications of this setup were:
You could build an APC on top of another wall item, provided there was nothing external attached to the wall and the area didn't have an APC.
You could stack Intercoms indefinitely on top of the same wall, provided you weren't in a one-tile wide corridor with something on the opposite wall.
Or both! Here's twenty Intercoms placed on the wall, and a freshly placed APC frame after placing all Intercoms and deconstructing the old APC:
endless-stack-of-intercoms
Not everything used this inverse variable to adjust to the correct direction. For example, /obj/machinery/defibrillator_mount just used a negative pixel_offset to be visually placed in the correct direction, even though the internal direction was wrong, and never set! This also let you stack an indefinite number of defib mounts on the same wall, provided it wasn't a northern wall... except you could do this to northern walls too, since defibs weren't considered a wall item for the purposes of checking collisions at all!
Ultimately, every constructable interior wall item either used this inverse variable to adjust to the correct placement, set a negative pixel_offset variable to have its offset adjusted to the correct placement, or overrode New or Initialize to run its own checks and assignment to pixel_x and pixel_y!
Inventory: Table of various paths, related paths, and the adjustments they used
Unfortunately, untangling /obj/structure/sign is going to be another major headache, and this has already exploded in scope enough already, so we can't get rid of the get_turf_pixel call just yet. This also doesn't fix problems with the special 2x1 /obj/structure/sign/barsign.
Some non-wall items have been made to use the new MAPPING_DIRECTIONAL_HELPERS as part of the directional cleanup.
tl;dr: All wall mounted items and some directional objects now use the same direction that they were labelled as. More consistent directional types everywhere.
Why It's Good For The Game
fml
Changelog
cl
refactor: Wall mounted and directional objects have undergone major internal simplification. Please report anything unusual!
fix: You can no longer stack an indefinite amount of Intercoms on the same wall.
fix: Defibrillator Mounts, Bluespace Gas Vendors, Turret Controlers, and Ticket Machines are now considered wall items.
fix: Wall mounted items on top of the wall now consistently check against other items on top of the wall, and items coming out of the wall now consistently check against other items coming out of the wall.
fix: The various directional pixel offsets within an APC, Fire Extinguisher Cabinet, Intercom, or Newscaster have been made consistent with each other.
fix: The pixel offsets of Intercoms, Fire Alarms, Fire Extinguisher Cabinets, Flashers, and Newscasters have been made consistent between roundstart and constructed instances.
fix: Constructed Turret Controls will no longer oddly overhang the wall they were placed on.
qol: Defibrillator mounts now better indicate which side of the wall they are on.
fix: Some instances where there were multiple identical lights on the same tile have been fixed to only have one.
/cl
* [MDB IGNORE] dir sanity, primarily on WALLITEMs
* apc directionals
* bluespace vendor fix
* defib fix
Co-authored-by: esainane <esainane+github@gmail.com>
Co-authored-by: jjpark-kb <55967837+jjpark-kb@users.noreply.github.com>
* Modernizing Radiation -- TL;DR: Radiation is now a status effect healed by tox healing, and contamination is removed
* Fixing conflicts
* Makes it compile, yeet all the RAD armor from everywhere (thanks RegEx!)
* Removing more lingering rad armor (woo)
* Damnit powerarmors
* Bye bye rad collectors!
Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
Co-authored-by: GoldenAlpharex <jerego1234@hotmail.com>
* removes double spaces before symbols (#62397)
This can apparently cause some bugs on occasions, so I thought I might as well try to kill them all.
* removes double spaces before symbols
Co-authored-by: John Willard <53777086+JohnFulpWillard@users.noreply.github.com>
* runtime fix for borgs cryoing with upgrade modules + no more mmi laying around after they cryo, and various other runtime fixes
* Fixing conflicts
Co-authored-by: Seris02 <49109742+Seris02@users.noreply.github.com>
Co-authored-by: GoldenAlpharex <jerego1234@hotmail.com>
* makes it so lockers/crates can have access electronics removed/inserted (#62022)
They can only have electronics inserted if they
are welded shut (if they can be welded)
don't have electronics already and aren't secure
They can only have electronics removed if they
are welded shut (if they can be welded)
are unlocked
are secure (even if they don't have electronics, then it'll create them)
* makes it so lockers/crates can have access electronics removed/inserted
Co-authored-by: Seris02 <49109742+Seris02@users.noreply.github.com>
* Drowsiness refactor (#62104)
Creates two procs in /mob/status_procs for handling drowsiness changes (with check for negative values), and refactors all code to use these procs instead of assigning values to the mob's drowsiness themselves.
* Drowsiness refactor
* Fixing more stuff in our code
Co-authored-by: thatoneplebeian <67017991+thatoneplebeian@users.noreply.github.com>
Co-authored-by: GoldenAlpharex <jerego1234@hotmail.com>
* Fixes a few hard deletes and runtimes I either caused, or ran into when trying to fix hard deletes (#61953)
Please don't try and send chat messages if you have nothing to say
Fixes a spurious runtime.
Fixes a runtime caused by my lack of understanding of huds. remove_hud_from is intended for hud watchers, remove_from_hud is intended for hud items. Doesn't really make sense most of the time, and just runtimes out the ass
Fixes a runtime in shapeshifting, restore should not run if the object is not restoring, or if it's deleting. it should run if it's not restoring, and it's not deleted. 4head
Fun fact, if there's two turret control boards they'll override each other. Use weakrefs. Oh also removes a var called cp, nothing good will come of that
Today in: Good lord the stacking machine is an afront to god, we discover that the labor claims console was attempting to act as a console, which of course fails when it comes time to clear it's improperly named var. Disgusting
Attempts to fix potential wound ref hangs in surgeries? maybe?
Fixes a runtime in luminescent stuff I created in my big harddel crusade. owner is a mob, not a species
Fixes a runtime related to headspikes deleting themselves twice. Pain
Fixes hard deletes sourced from the prophet trauma. Good fucking lord this is awful
Offhand item is somehow hard deleting. I have no idea how. Here's hoping signals fixes it, because if it doesn't I'm stumped. It's not a common scenario, but it does happen in spurts that suggest repeated usage
* Fixes a few hard deletes and runtimes I either caused, or ran into when trying to fix hard deletes
* Update turret_id_system.dm
* Update turret_id_system.dm
Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
Co-authored-by: Gandalf <jzo123@hotmail.com>
* Delete seeds whenever a plant is deletes, delete plant genes when a seed is deleted, + refactor various gene adding / deleting (#61747)
* Delete seeds whenever a plant is deletes, delete plant genes when a seed is deleted, + refactor various gene adding / deleting
Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com>
* [TM Candidate] Overhauls orbit and POI code to fix part of issue #61508 where players could observe /mob/living/new_player on the lobby.
* E
* Missed merge
Co-authored-by: Timberpoes <silent_insomnia_pp@hotmail.co.uk>
Co-authored-by: Gandalf <jzo123@hotmail.com>
* Things that love the station may no longer leave the station, even when Dr. Anomaly says they should. (#61335)
Bluespace anomalies detonating Move() things. When something is Move()d, none of the logic in forceMove() or doMove() is called, and thus stationloving things can't tell when they've left the z-level (since that's where the logic for it is).
There are a number of approaches I could have taken: Refactoring anomalies to use different movement code. Refactoring Movement code to send more signals in various scenarios. Refactoring the stationloving component.
I settled on two steps. First, refactoring the component to bring it up to modern code standards. Second, moving the logic for COMSIG_MOVABLE_Z_CHANGED to Moved() so the signal always fires regardless of if Move() or forceMove() or doMove() is used, with an optional var for whether the z-change is communicated to contents. This means the ore box was changed to actually send the signal instead of just returning with no parent call or signal sent. Stationloving ore boxes when?
stationloving procs no longer call SIGNAL_HANDLERs directly. Var names are now more descriptive. Things are renamed and documented. At least for the parts of the code I know.
Probably some other code cleanups.
* Things that love the station may no longer leave the station, even when Dr. Anomaly says they should.
Co-authored-by: Timberpoes <silent_insomnia_pp@hotmail.co.uk>
* fix aux base console (#61306)
the Auxbase console is a subtype of consoles, despite being a wallmount, therefore it inherits consoles density = TRUE, despite being on a wall
this means that you get THIS ..... its on the WALL and the tile is EMPTY, but you cant step onto it, because the consoles there technically and dense
(I feel i should clarify before its asked: when a console is deconstructed it spawns a new console frame and copies the circuit over, that new frame will be dense again. so it only lacks density once its finished and on the wall)
* Makes Auxbase console a proper wallmount
Co-authored-by: 小月猫 <alina.r.starkova@gmail.com>
* Lavaland bottle holyness correctly not a species trait (#61409)
This is not a species granted trait, seems it was like this out of laziness but correct me if you know better
(Arm: It's just a remnant of angel's being a species in the past)
* Lavaland bottle holyness not a species trait
Co-authored-by: TiviPlus <57223640+TiviPlus@users.noreply.github.com>
* Baton refactor. item/melee/baton is now a subtype of item/melee/baton (formerly classic_baton)
* EEEE
* E
* follow the fucking guidelines
* E
* Update CentCom_skyrat.dmm
Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com>
Co-authored-by: Gandalf <jzo123@hotmail.com>
* Revert "Revert "[MIRROR] Refactor area and turf lighting (#7775)" (#7902)"
This reverts commit 64c4c52d12.
* This should probably fix it
* I love linters
Co-authored-by: GoldenAlpharex <jerego1234@hotmail.com>
* Fix wormhole jaunter behavior with chasms and EMP (#61055)
Wormhole jaunters will now save the user from a chasm if they fall in and it's on their belt. Wormhole jaunters also are affected by EMP correctly. Before it would only be affected by an EMP if it was in the belt storage area which made no sense.
Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@ users.noreply.github.com>
(Lots of good work here, thank you tim)
* Fix wormhole jaunter behavior with chasms and EMP
Co-authored-by: Tim <timothymtorres@gmail.com>
* makes fake artefacts better (#61185)
adds the lefthand and righthand icons to the artefact, and gets rid of the big blue x overlay
* makes fake artefacts better
Co-authored-by: Seris02 <49109742+Seris02@users.noreply.github.com>
* Fixes a regression about skeleton pirates not having milk bottles. (#61217)
* Fixes a regression about skeleton pirates not having milk bottles.
* aaaa
* Fixes a regression about skeleton pirates not having milk bottles.
Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com>
* lava and weather immunities refactor (also jump boots fix) (#61003)
In remembrance of all those people who used jump boots to cross lava unaware of an issue c*ders wouldn't fix....
EDIT: This is now a lava and weather immunities refactor:
Weather immunities are now status traits since they have a multitude of sources (especially for lava) which might conflict with one another otherwise.
The lava burn_stuff proc has also been been refactored in different procs, mostly because of that snowdin subtype with inconsistent, old checks.
Weather datums should now use can_weather_act instead of weather_act to check if something can be affected by weather or not, as they should.
All movables can protect contained mobs if they have the relative weather immunity traits. This works at any contents depth.
No more snowflake weather_protection variable for closets.
Removed the weather_immunities list from living mobs (simple animals still have it but it's only for traits assignment on init because way too many child types lack the immunities of their parents).
Removed some unused defines.
Renamed some variables as per guidelines.
It has been tested.
And yea, jump boots fixed because that's the original scope of this PR.
(Initially just made throwing make you fire immune, that was blocked because it breaks perma stuff, instead it ended up be a refactor to make jumpboots usable with weather immumnity stuff
* lava and weather immunities refactor (also jump boots fix)
* Update Ashwalkers.dm
Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com>
Co-authored-by: Gandalf <jzo123@hotmail.com>
Repaths everything referring to "toxins" while actually meaning either the room in science or plasma gas. While this PR might be disrespectful to our forefathers, given this is (I believe) a holdover from as far back as the Exadv1 days, this has constantly irked me since I started working with the code. None of the player-facing stuff has referred to plasma as toxin since before 4407 hit, besides the Toxins Lab, and yet all of the type-paths are still pointing at toxins, making it a nightmare to search for in a map editor, and making the code needlessly easy to confuse with that of toxin damage. So this just fires it into the sun.
Anything relating to Toxins, the science subdepartment, now makes reference to Ordnance instead. This felt fitting enough given the focus of the subdepartment is around the creation of and testing of explosives.
Anything relating to plasma gas has, fittingly, been made to refer to plasma gas.
Edit: Ah yes, I feel I should probably apologise off the bat for the size of this PR- the code touched is mostly atmos machinery and simplemobs, a few sprites here and there, and of course the station maps + a few offstation maps.
Makes the code more legible and makes mapping less painful.
(The payment has been made)
Co-authored-by: EOBGames <58124831+EOBGames@users.noreply.github.com>
Co-authored-by: Gandalf <jzo123@hotmail.com>
* Fix staff of lava not terraforming lava (#61096)
Lava staffs were not terraforming regular lava into empty tiles. This is because it was only checking to see if the lava type was the same weak lava the staff spawns. It has now been fixed to check for all lava types.
* Fix staff of lava not terraforming lava
Co-authored-by: Tim <timothymtorres@gmail.com>
* Refactors connect_loc_behalf into a component (#60678)
See title. Also refactors caltrops into a component because they use connect_loc_behalf which requires them to hold the state.
This also fixes COMPONENT_DUPE_SELECTIVE from just outright not working.
connect_loc_behalf doesn't make sense as an element because it tries to hold states. There is also no way to maintain current behaviour and not have the states that it needs.
Due to the fact that it tries to hold states, it means the code itself is a lot more buggy because it's a lot harder to successfully manage these states without runtimes or bugs.
On metastation, there is only 2519 connect_loc_behalf components at roundstart. MrStonedOne has told me that datums take up this much space:
image
If we do the (oversimplified) math, there are only ever 5 variables that'll likely be changed on most connect_loc_behalf components at runtime:
connections,
tracked,
signal_atom,
parent,
signal_procs
This means that on metastation at roundstart, we take up this amount: (24 + 16 * 5) * 2519 = 261.97600 kilobytes
This is not really significant and the benefits of moving this to a component greatly outweighs the memory cost.
(Basically the memory cost is outweighed by the maint cost of tracking down issues with the thing. It's too buggy to be viable longterm basically)
* Update glass.dm
Co-authored-by: Watermelon914 <37270891+Watermelon914@users.noreply.github.com>
Co-authored-by: Gandalf <jzo123@hotmail.com>
* Del The World: Unit testing for hard deletes (#59612)
Co-authored-by: SteelSlayer <42044220+SteelSlayer@ users.noreply.github.com>
* Del The World: Unit testing for hard deletes
Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
Co-authored-by: SteelSlayer <42044220+SteelSlayer@ users.noreply.github.com>