Commit Graph

8 Commits

Author SHA1 Message Date
Mothblocks
c1d68698fb Micro-optimize qdel by only permitting one parameter (#80628)
Productionizes #80615.

The core optimization is this:

```patch
-	var/hint = to_delete.Destroy(arglist(args.Copy(2))) // Let our friend know they're about to get fucked up.
+	var/hint = to_delete.Destroy(force) // Let our friend know they're about to get fucked up.
```

We avoid a heap allocation in the form of copying the args over to a new
list. A/B testing shows this results in 33% better overtime, and in a
real round shaving off a full second of self time and 0.4 seconds of
overtime--both of these would be doubled in the event this is merged as
the new proc was only being run 50% of the time.
2023-12-28 13:52:44 -08:00
Zephyr
ecbcef778d Refactors Regenerate Organs, and a few organ helpers (#74219)
## About The Pull Request

Refactors regenerate organs to be slightly more intelligent in handling
organ changes and replacements.
Noteably:
- We don't remove organs that were modified by the owner; such as
changing out your heart for a cybernetic
- We early break out of the for loop if they aren't supposed to have an
organ there and remove it
- We check for the organ already being correct, and just healing it and
continuing if it is

Also changes the names of some of the organ helpers into snake_case
### Mapping March
Ckey to receive rewards: N/A

## Why It's Good For The Game
## Changelog

---------

Co-authored-by: Jacquerel <hnevard@gmail.com>
2023-03-26 17:54:36 +01:00
AnturK
4d6a8bc537 515 Compatibility (#71161)
Makes the code compatible with 515.1594+

Few simple changes and one very painful one.
Let's start with the easy:
* puts call behind `LIBCALL` define, so call_ext is properly used in 515
* Adds `NAMEOF_STATIC(_,X)` macro for nameof in static definitions since
src is now invalid there.
* Fixes tgui and devserver. From 515 onward the tmp3333{procid} cache
directory is not appened to base path in browser controls so we don't
check for it in base js and put the dev server dummy window file in
actual directory not the byond root.
* Renames the few things that had /final/ in typepath to ultimate since
final is a new keyword

And the very painful change:
`.proc/whatever` format is no longer valid, so we're replacing it with
new nameof() function. All this wrapped in three new macros.
`PROC_REF(X)`,`TYPE_PROC_REF(TYPE,X)`,`GLOBAL_PROC_REF(X)`. Global is
not actually necessary but if we get nameof that does not allow globals
it would be nice validation.
This is pretty unwieldy but there's no real alternative.
If you notice anything weird in the commits let me know because majority
was done with regex replace.

@tgstation/commit-access Since the .proc/stuff is pretty big change.

Co-authored-by: san7890 <the@san7890.com>
Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
2022-11-15 03:50:11 +00:00
Kapu1178
6d470992cb This tail refactor turned into an organ refactor. Funny how that works. (#67017)
* Fuck you (refactors ur tails)

* Errors

* Wow. Pain.

* Fixes up probably everything

* finish up here

* Fixes hard del maybe

* original owner hard del

* garbage collection runtime

* suck my peen byond

* Mapped tails

* motherfucker.

* motherrfucker. again.

* Whooopppppsie

* yeah bad idea

* Turns out external organs literally just sat in nullspace forever if their parent was deleted, and didnt Remove() themselves, causing harddels.

* So anyways I repathed all organs

* Fixes

* really.

* unit test... test

* unit test-test but it passes linters this time because im a moh-ron

* I've lost track of what im doing at this point

* Hopefully fixes hard del?

* meh

* Update code/datums/dna.dm

* things n stuff

* repath from master pull
2022-05-30 21:18:34 -07:00
Watermelon914
375a20e49b Refactors most spans into span procs (#59645)
Converts most spans into span procs. Mostly used regex for this and sorted out any compile time errors afterwards so there could be some bugs.
Was initially going to do defines, but ninja said to make it into a proc, and if there's any overhead, they can easily be changed to defines.

Makes it easier to control the formatting and prevents typos when creating spans as it'll runtime if you misspell instead of silently failing.
Reduces the code you need to write when writing spans, as you don't need to close the span as that's automatically handled by the proc.

(Note from Lemon: This should be converted to defines once we update the minimum version to 514. Didn't do it now because byond pain and such)
2021-06-14 13:03:53 -07:00
Jared-Fogle
477d97647e Move death(), gib(), and dust() from /mob to /mob/living (#54810)
These have no reason to exist on /mob, where they noop for any nonliving.
2020-11-08 10:32:04 -05:00
Jared-Fogle
45c14f6330 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
2020-08-20 09:11:28 +12:00
Ryll Ryll
75af862fee Buffs immersion, adds manual blinking and inhale/exhale checks (#47704)
* *blink *inhale *exhale *blink *inhale *blink *exhale

* rapidly blinks

* mass immersion

* how was that even working

* manual blinking today, manual breathing tomorrow

* b

* cleansed

* more neatening

* minus check

* Update code/modules/admin/verbs/randomverbs.dm

Co-Authored-By: Emmett Gaines <ninjanomnom@gmail.com>

* un-nom's my code

Co-Authored-By: Emmett Gaines <ninjanomnom@gmail.com>

* un-nom's my code

* less
2019-12-04 16:02:42 +00:00