Commit Graph

5 Commits

Author SHA1 Message Date
oranges
74e43bc556 Improve the naming of the element argument hash index selector (#71319)
So confusing name
2022-11-19 17:04:28 -08: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
Mothblocks
60ee087b16 Remove ELEMENT_DETACH on everything that doesn't need it, rename to ELEMENT_DETACH_ON_HOST_DESTROY + a PSA (about 0.2s init time savings) (#70972)
ELEMENT_DETACH is **not** a requirement to having `Detach` called.
Detach is always called when the element itself is destroyed.

ELEMENT_DETACH is a flag that when set, makes sure Detach is called when
the atom destroys.

Sometimes you want this, for instance:

```dm
/datum/element/point_of_interest/Detach(datum/target)
	SSpoints_of_interest.on_poi_element_removed(target)
	return ..()
```

This Detach cleans up a reference that would have hung if target was
destroyed without this being called.

However, most uses of Detach are cleaning up signals. Signals are
automatically cleaned up when something is destroyed. You do not need
ELEMENT_DETACH in this case, and it slows down init. This also includes
somewhat more complex stuff, like removing overlays on the source
object. It's getting deleted anyway, you don't care!

I have removed all uses of ELEMENT_DETACH that seemed superfluous. I
have also renamed it to `ELEMENT_DETACH_ON_HOST_DESTROY` to make its
purpose more clear, as me and a lot of other maintainers misunderstood
what it did,

---

An update to this, ELEMENT_DETACH *is* needed for anything that can
register to a turf, as turfs do not clear their signals on destroy.
2022-11-05 15:00:59 +01:00
Jacquerel
bcadead566 Chasm Fishing (#69252)
Adds the capability of fishing in chasms.
Chasms contain Chasm Chrabs, which are cute little crustaceans you can eat or put in an aquarium.
More importantly, chasms contain everything which has ever fallen into a chasm.
Falling into a chasm is no longer instant permanent round removal... as long as someone is willing to do some fishing, which means your chances of return haven't necessarily increased that much.

Potential rescuers (or people lamenting about how they dropped their necropolis chest into a hole) should also beware, chasm crabs are actually young Lobstrosities and there's a rare but not insubstantial chance that you'll fish one of them up instead, which won't make it very happy.

If you somehow come back to life inside a chasm (generally only likely by being a changeling or some admin interference, but perhaps you have some kind of implant which does it) you'll climb back out again, so holes are no longer a way of disposing of a changeling for good. You think The Thing would be defeated if you threw it down a hole?
Ethereals can't manage this because falling into a chasm causes too much damage and they simply smash on the way down.

add: You can now fish in chasms, and might manage to catch things that careless miners have dropped in there.
add: If your pole is long enough to reach into a deep hole, you might catch crabs.
balance: Changelings can climb out of chasms if you throw them into one.
imageadd: An icon of a nice little crab, who will grow up into something less nice.
add: You can craft fishing equipment from various lavaland materials, so that Ashwalkers can fish up dead miners before you.
add: You can sometimes find worms while digging up tiles, if appropriate for that material.
2022-08-25 20:13:36 -07:00
MrMelbert
325915e459 Converts diggable from component to bespoke element (#67695)
* Changes diggable to an element and fixes it, saving on some memory.
2022-06-19 11:25:37 -04:00