Commit Graph

55 Commits

Author SHA1 Message Date
SkyratBot
b8d9874c27 [MIRROR] Converts all A && A.B into A?.B (#1292)
* Converts A && A.B into A?.B (#54342)

Implements the ?. operator, replacing code like A && A.B with A?.B

BYOND Ref:
When reading A?.B, it's equivalent to A && A.B except that A is only evaluated once, even if it's a complex expression like a proc call.

* Converts all A && A.B into A?.B

Co-authored-by: ZeWaka <zewakagamer@gmail.com>
2020-10-13 23:19:25 +02:00
SkyratBot
756b97a0fb [MIRROR] Converts some unique and typelists into stringlists (#1284)
* Converts some unique and typelists into stringlists (#54237)

* Converts some unique and typelists into stringlists

Co-authored-by: Rohesie <rohesie@gmail.com>
2020-10-13 08:03:58 +02:00
SkyratBot
1dfe6e9e85 [MIRROR] Unit tests for serving trays (#1199)
* Unit tests for serving trays (#54224)

* Unit tests for serving trays

Co-authored-by: NightRed <nightred@gmail.com>
2020-10-08 02:42:27 +02:00
SkyratBot
e65a48e91f [MIRROR] Adds SIGNAL_HANDLER and SIGNAL_HANDLER_DOES_SLEEP to prevent signal callbacks from blocking (#430)
* Adds SIGNAL_HANDLER and SIGNAL_HANDLER_DOES_SLEEP to prevent signal callbacks from blocking (#52761)

Adds SIGNAL_HANDLER, a macro that sets SHOULD_NOT_SLEEP(TRUE). This should ideally be required on all new signal callbacks.

Adds BLOCKING_SIGNAL_HANDLER, a macro that does nothing except symbolize "this is an older signal that didn't necessitate a code rewrite". It should not be allowed for new work.

This comes from discussion around #52735, which yields by calling input, and (though it sets the return type beforehand) will not properly return the flag to prevent attack from slapping.

To fix 60% of the yielding cases, WrapAdminProcCall no longer waits for another admin's proc call to finish. I'm not an admin, so I don't know how many behinds this has saved, but if this is problematic for admins I can just make it so that it lets you do it anyway. I'm not sure what the point of this babysitting was anyway.

Requested by @optimumtact.
Changelog

cl
admin: Calling a proc while another admin is calling one will no longer wait for the first to finish. You will simply just have to call it again.
/cl

* Adds SIGNAL_HANDLER and SIGNAL_HANDLER_DOES_SLEEP to prevent signal callbacks from blocking

Co-authored-by: Jared-Fogle <35135081+Jared-Fogle@users.noreply.github.com>
2020-08-19 20:17:28 -04:00
jdawg1290
62676e72a8 Force LF line endings with gitattributes and convert repo (#52266)
Co-authored-by: Aleksej Komarov <stylemistake@gmail.com>
2020-07-16 03:02:40 +03:00
AnturK
f4af5ed28c Makes CanReach default to blocking. (#52115) 2020-07-12 04:25:27 +10:00
Tad Hardesty
4e666f1325 Remove unnecessary incapacitated check 2020-06-27 14:39:20 -07:00
ivanmixo
6351f3837d replaces the thing with user.incapacitated() 2020-06-19 22:54:51 +02:00
Rohesie
b940ce3ff9 progressbar refactor (#50316) 2020-04-01 14:38:55 +08:00
ShizCalev
7209ac3c93 Removes unnessacary math defines 2020-02-17 23:09:09 -05:00
Ghom
1e15900f2d Fixes shock paddles being insertable in BoH (#48643)
* Fixes shock paddles being insert able in BoH

* Redundant.
2020-01-12 19:34:20 -08:00
Dennok
a2fc1614a6 You do not lose the storage window on storage pickup. (#48685)
* do not lose the storage window on pickup

do not lose the storage window on pickup

* Keep update_actions()
2020-01-10 21:35:02 +11:00
81Denton
f5bd6a381d Merge pull request #47052 from kingofkosmos/misc_span_fixes1
Misc span fixes
2019-10-20 18:46:54 +02:00
kingofkosmos
52325eda25 Merge branch 'master' of https://github.com/tgstation/tgstation into misc_span_fixes1
# Conflicts:
#	code/game/machinery/Sleeper.dm
#	code/game/machinery/doors/airlock.dm
#	code/game/objects/structures/beds_chairs/chair.dm
#	code/game/objects/structures/lavaland/geyser.dm
#	code/modules/antagonists/clockcult/clock_effects/clock_sigils.dm
#	code/modules/antagonists/clockcult/clock_mobs/_eminence.dm
#	code/modules/paperwork/contract.dm
2019-10-17 06:02:06 +03:00
nemvar
9467c73899 Checks if the tick has stopped. 2019-10-16 19:25:16 +02:00
nemvar
ced45cfddd Fixes forceMove to null 2019-10-16 19:21:41 +02:00
PKPenguin321
deeac2355a Big storage containers (like bags) in smaller ones (like boxes) can't have items placed in them (#46983)
* Bags in boxes can't have items placed in them

Untested webedit
Fixes https://github.com/tgstation/tgstation/issues/46345

* smooths a redundant check

* more squishing
2019-10-14 07:05:06 +02:00
kingofkosmos
280d416d4f Adds missing spans, missing periods and missing span endings. Also changes spans to suit the situation better. 2019-10-12 19:34:11 +03:00
nemvar
8cfe0f6467 Slightly improves visible and audible messages. (#46499)
* Doubtful improvement

* Switches out all the magic numbers with defines

* Thanks travis for finally finding a real error

* properly resolves some left over conflict
2019-09-18 12:52:18 +02:00
Rob Bailey
2029163d33 playsound vary boolean define conversion (#46254)
About The Pull Request

Converts every single usage of playsound's vary parameter to use the boolean define instead of 1 or 0. I'm tired of people copypasting the incorrect usage.
Also changes a couple of places where a list was picked from instead of using get_sfx internal calls

This was done via regex:
(playsound\(.+,.+,.+, ?)1( ?\)| ?,.+\)) to match 1
(playsound\(.+,.+,.+, ?)0( ?\)| ?,.+\)) to match 0
full sed commands:
/(playsound\(.+,.+,.+, ?)1( ?\)| ?,.+\))/\1TRUE\2/ 1 to TRUE
/(playsound\(.+,.+,.+, ?)0( ?\)| ?,.+\))/\1FALSE\2/ 0 to FALSE

I'm not very good with regex and these could probably be optimized, but they worked.
Why It's Good For The Game

Code usability
2019-08-30 18:45:20 +12:00
nemvar
1ec07b1508 Fixes that pesky dumping issue (#46025) 2019-08-21 01:08:36 -07:00
Mickyan
e26abb7047 Random pixel shift for dropped/thrown objects (#45155)
* pixels

* offset for any throw, critical bedsheet bugfix

* nyeh

* might as well (autodoc)

* renamed proc

* removed redundant src

* moved call from dropped() to dropItemToGround()

* handles storage dumping, customizable max offset

* adjusted values

* inline
2019-07-16 00:51:17 -07:00
kingofkosmos
ec5c82029a * "Is already...", "Can not...", "Not when..." etc. 2019-06-27 06:15:43 +03:00
Emmett Gaines
c3f95024b2 Gets rid of the GetComponent macros (#44220)
* Removes the GetComponent macros

* Regex replacement for GET_COMPONENT

Search: `GET_COMPONENT\( *(.+?) *, *(.+?) *\)`
Replace: `var$2/$1 = GetComponent($2)`

* Regex replacement for GET_COMPONENT_FROM

Search: `GET_COMPONENT_FROM\( *(.+?) *, *(.+?) *, *(.+?) *\)`
Replace: `var$2/$1 = $3.GetComponent($2)`
2019-06-04 17:39:58 +02:00
Akrilla
2d32be1904 Small storage refactor and examine change (#44109)
* Removes repeated line

* Description change for clothing items that can only store specific items

* Get all children of can_hold listed items.

* can_hold only needs the top most item, child items are dealt automatically

* cant_hold related change

* Text change

* Moves the item check to the line above, and removes the current.

* Same changes, but to belt/wallet code.

* Change to using signals instead

* Generic signal on datum/topic

* Cache typecache, and small signal change

* Small argument tweaks and remove unneeded lists

* Change to proc

* Change call can_holds/cant_holds to use new proc

* initial, and cleaned up display code

* Null check
2019-05-30 14:20:29 -04:00
Akrilla
55ed0ebf35 Fedoras hold small and gimmick items (#44139)
* This was probably originally intended...

* Fedoras hold small items, and exceptions for gimmicks

* Only create cache once

* Cache exception_hold, and adds other katana type
2019-05-28 09:57:59 -04:00
vuonojenmustaturska
fb45b7a017 Turns trait accessors into defines, fixes some bugs (#43820)
It's free performance.
2019-05-06 19:44:05 -04:00
coiax
881e8c1ab9 Refactors NODROP flag into TRAIT_NODROP (#42109)
* Refactors NODROP flag into TRAIT_NODROP

🆑 coiax
fix: Anti-drop implants can no longer be used to drop objects that they
were not responsible for sticking to a person's hand.
fix: Backfiring with a Barnyard spellbook will now play a spooky horse sound.
refactor: Refactors the way that "NODROP" items work to a new system,
there should be no change in functionality.
/🆑

Various items in the codebase were doing weird hoop jumps in order to
preserve the nodrop flag's state when it also wanted to change it, so I
moved it to a trait system.

I may have gone overboard with the type of unique trait sources, but
those can be changed later. My long term plan is make a general "CURSED"
nodrop origin, which means you can unlock cursed items by being hit with
a bolt of door opening or something. But that's for another PR, this has
no functionality changes, apart from some slightly modified descriptions
on cursed masks.

- Removed a bunch of redundant voice changing code for all the voice
changing animal masks, used two new clothing flags for this purpose.
- Also refactored a bit the animal masks, making new cursed subtypes that play
the sound when created.

* Drop location
2019-01-17 15:24:30 -05:00
skoglol
4a5fc9e14e Makes satchels stack by name instead of type (#41827)
* Makes satchels stack by name

* Type and name and hopefully fixed branch?
2018-12-23 16:30:34 +11:00
oranges
0e982cad32 Merge pull request #41921 from kevinz000/patch-584
Fixes some instances of storage not closing when it should (on move)
2018-12-16 13:02:44 +13:00
coiax
d27c64c3a8 Christmas code changes (#41763)
* Christmas code changes

🆑 coiax
add: Santa can now examine presents to see what's inside.
del: Santa no longer has a mass summon presents spell, because of his
new regenerating bag!
add: Santa's bag regenerates presents as long as Santa is holding it.
balance: You can only find one gift under a christmas tree per round, no
matter how many trees you search.
balance: Santa's teleport does not announce where he's going.
fix: Fixed Santa not having a full head and beard of white hair.
fix: Fixed Santa not being genetically white-haired.
fix: Fixed Concentrated Barber's Aid not growing extreme amounts of
hair.
/🆑

The `box` var has been moved down from `/datum/outfit/job` to
`/datum/outfit`.

Added unlimited christmas tree with presents, for testing.

Santa's restriction against opening presents is now done by
TRAIT_CANNOT_OPEN_PRESENTS. Santa's ability to see inside presents is
done by the TRAIT_PRESENT_VISION, which also determines if Santa's Bag
will regenerate presents every 30 to 60 seconds.

Santa no longer starts with a breath mask and O2 tank, but instead has
an internals box. Santa no longer has a no-access gold ID, he can
teleport from room to room!

Gifts determine what type is inside them on initialization, rather than
when unwrapped.

- Reasoning -

Unlike last year, there are various possible methods of accessing
christmas trees spawners, allowing for an unlimited number of anything
presents. Cutting down the presents to one per round regardless of tree
count will avoid this.

Santa should be able to see what he's giving, because then he can reward
the naughty and nice children with different gifts.

* Missed a merge

* Adds present investigate logs, and visible messages

* Use the body+mind checking of mob.has_trait

* Less globals, more static vars on types; also event renaming
2018-12-16 12:44:53 +13:00
kevinz000
18860d2346 Update storage.dm 2018-12-12 04:45:38 -08:00
skoglol
6aac8b26bc Open storage by alt clicking (#41712)
Provides an alternative to click-dragging.

The on_alt_click() proc wasn't ever used, but seemed to be ready for replacing
the AltClick() overload from sabre sheath. I kept that part and added
fingerprints to it as well, and it is still good to go (if it really was)
whenever someone bothers.
2018-11-29 21:40:32 -08:00
MrDoomBringer
3d24bc0f08 Prevents blob overminds, sentient diseases, etc. from dumping out boxes (#40823)
* nerf boxes

* uuh i think i see what you mean. hows this

* shuffles it over to mob.dm

* asdf

* hows this

* ooga

* i should probably rebase

* t

* cheaper and stronger unlike me

* aaaaa

* does the thing with the words
2018-10-26 22:03:09 +02:00
kevinz000
3e7184c975 Combat/Stun (slip) overhaul staging, mobility flags, adds crawling (#39967)
Aiming to implement the framework oranges has detailed in https://tgstation13.org/phpBB/viewtopic.php?f=10&t=19102
Moves canmove to a bitflag in a new variable called mobility_flags, that will allow finer grain control of what someone can do codewise, for example, letting them move but not stand up, or stand up but not move.

Adds Immobilize()d status effect that freezes movement but does not prevent anything else.
Adds Paralyze()d which is oldstun "You can't do anything at all and knock down).
Stun() will now prevent any item/UI usage and movement (which is similar to before).
Knockdown() will now only knockdown without preventing item usage/movement.
People knocked down will be able to crawl at softcrit-speeds
Refactors some /mob variables and procs to /mob/living.
update_canmove() refactored to update_mobility() and will handle mobility_flags instead of the removed canmove

cl
rscadd: Crawling is now possible if you are down but not stunned. Obviously, you will be slower.
/cl
Refactors are done. I'd rather get this merged faster than try to fine tune stuff like slips. The most obvious gameplay effect this pr has will be crawling, and I believe I made tiny tweaks but I can't find it Anything I missed or weird behavior should be reported.
2018-10-11 11:22:21 +13:00
Emmett Gaines
0943e56e08 Adds the signal origin as the first arg to all signals (#39861)
* Adds the signal origin as the first arg to all signals

* Fixes some storage and nanite procs
2018-08-28 18:28:29 +03:00
kevinz000
1bfa10d012 Fix bio bags not working for reproductive extracts (#39753)
> Take 1
> Length of cubes is above 1
> Cut(1)
> Wait that just cut the entire list to nothing

Now the signal should work properly instead of not working whenever there's
more of a thing than the requested amount.
2018-08-23 19:32:01 -07:00
Jared-Fogle
0308655a68 Hovering over storage slots with an item in your hand will show you if you can put the item in (#39661)
Quality of life. Sometimes I forget whether or not I can put an item in my suit storage/pockets. Note this doesn't trigger for hands.
2018-08-17 16:24:56 -07:00
ninjanomnom
befaa09c88 Removes a couple storage GetComponent calls 2018-08-02 00:52:12 -04:00
Emmett Gaines
44da4cb683 Makes magnetic catch cleaner in game (#38956)
Utilizes the new signal refactor to cancel throws before they happen. This prevents the silly spin even though the throw was stopped.
2018-07-13 10:31:30 +02:00
Emmett Gaines
34a3d2da4d Refactors component signals registration (#38798)
Datums know what signals are being listened for and components can now be registered to listen for signals on more than one object.
2018-07-05 00:56:39 +03:00
ShizCalev
ff532a4ca4 Spellchecks TGStation 2018-06-19 18:57:44 -04:00
ninjanomnom
d483ff3ef0 Regexes
`([^_\.])SendSignal\((.+?)\)` -> `\1SEND_SIGNAL(src, \2)`
`([\.\w]+?)\.SendSignal\((.+?)\)` -> `SEND_SIGNAL(\1, \2)`
2018-06-13 19:19:23 -04:00
Tad Hardesty
106f5af48b Fix lockboxes not actually being locked 2018-06-08 23:22:12 -07:00
Tad Hardesty
1ed3b1b589 Fix paradox bags (#38212)
* Fix linked storages not initializing correctly

* Rewrite CanReach to handle multiparent storages

* Fix being able to click anything
2018-06-08 13:47:30 +02:00
vuonojenmustaturska
c65a99f130 Move NODROP_1, DROPDEL_1, ABSTRACT_1 and NOBLUDGEON_1 to item_flags where they belong (#38171)
* (mostly) nodrop

* (mostly) dropdel

* (mostly) abstract

* nobludgeon

* things i missed

* forgot one

* unintended changes

* energy handcuffs
2018-06-01 11:36:31 +02:00
Tad Hardesty
f53caac04a Refresh mob views when atoms enter/exit storage (#37954) 2018-05-21 12:45:52 +03:00
kevinz000
85aef5755a Fixes EMPs (#37656) 2018-05-10 08:32:40 +02:00
kevinz000
2d91fdbd93 Fixes mousetraps not going off from being dumped out (#37447)
* mousetrap fix

* fix mousetraps

* Update storage.dm

* Combine checks
2018-05-04 11:42:55 +02:00
Jordan Brown
8ce7d19c9c Merge pull request #37565 from ninjanomnom/component-limbo
Modifies component transfer to make ChangeTurf able to transfer components
2018-04-30 22:16:47 -04:00