Commit Graph

5 Commits

Author SHA1 Message Date
SkyratBot
3e80a1bd00 [MIRROR] Fixes another image harddel in station blueprints (and more) [MDB IGNORE] (#26012)
* Fixes another image harddel in station blueprints (and more) (#80780)

## About The Pull Request

![image](https://github.com/tgstation/tgstation/assets/13398309/063c58ef-6233-4c91-aaf0-7e9589c0e912)

Tin. Just more uncovering of some of these image harddels.
`blueprint_data` is a list of images.

I also went through the code and looked for any more instances of images
being qdeleted that I could find.

## Why It's Good For The Game

Hard dels begone

## Changelog

🆑
fix: fixes an /image harddel in station blueprints
code: cleaned up some more /image qdels
/🆑

* Fixes another image harddel in station blueprints (and more)

---------

Co-authored-by: Bloop <13398309+vinylspiders@users.noreply.github.com>
2024-01-05 20:18:09 +00:00
SkyratBot
067188d366 [MIRROR] Micro-optimize qdel by only permitting one parameter [MDB IGNORE] (#25889)
* 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.

* Micro-optimize qdel by only permitting one parameter

---------

Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
2023-12-29 14:41:12 +00:00
SkyratBot
bbd547ec95 [MIRROR] Targeting Datums Renamed (and global) [MDB IGNORE] (#24885)
* Targeting Datums Renamed (and global) (#79513)

## About The Pull Request

[Implements the backend required to make targeting datums
global](6901ead12e)

It's inconsistent with the rest of basic ai for these to have a high
degree of state, plus like, such a waste yaknow?

[Implements
GET_TARGETING_STRATEGY](d79c29134d)

Regexes used:
new.*(/datum/targetting_datum[^,(]*)\(*\)* -> GET_TARGETING_STRATEGY($1)

Renamed all instances of targetting to targeting (also targetting datum
-> targeting strategy)

I've used GET_TARGETING_STRATEGY at the source where the keys are
actually used, rather then in the listing. This works out just fine.

## Why It's Good For The Game

Not a misspelled name through the whole codebase, very slightly less
memory load for basically no downside (slight cpu cost maybe but not a
significant one.

---------

Co-authored-by: John Willard <53777086+JohnFulpWillard@ users.noreply.github.com>

* Targeting Datums Renamed (and global)

* Update dogs.dm

* Modular

* Modular

* Modular

* Merge skew?

* Revert "Merge skew?"

This reverts commit 0889389ab5cb5c56655f1860d9173ba87efe9a22.

---------

Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
Co-authored-by: John Willard <53777086+JohnFulpWillard@ users.noreply.github.com>
Co-authored-by: Bloop <13398309+vinylspiders@users.noreply.github.com>
2023-11-09 16:37:48 -05:00
SkyratBot
c529b754fb [MIRROR] Fixes a bunch of callbacks that were being qdeleted, and code cleanup [MDB IGNORE] (#23319)
* Fixes a bunch of callbacks that were being qdeleted, and code cleanup (#77904)

## About The Pull Request

![image](https://github.com/tgstation/tgstation/assets/13398309/559eb50a-461c-4220-b628-55412baaffc3)

Continuing the work of
https://github.com/tgstation/tgstation/pull/77850.

it started with finding one that was being missed and causing a
runtime...then I noticed a whole lot more. While I was doing this I
found callbacks that weren't being nulled in `Destroy()`, so I added
that wherever I found these spots as well as some general code cleanup.

There were a lot more of these than I initially hoped to encounter so
I'm labeling it as a refactor.

## Why It's Good For The Game

Fixes lots of runtimes, improves code resiliency.

## Changelog

🆑
refactor: fixed a bunch of instances of callbacks being qdeleted and
cleaned up related code
/🆑

* Fixes a bunch of callbacks that were being qdeleted, and code cleanup

---------

Co-authored-by: Bloop <13398309+vinylspiders@users.noreply.github.com>
2023-08-25 19:06:07 -04:00
SkyratBot
ac2b1d5ec7 [MIRROR] Restores Spell Card targetting behaviour [MDB IGNORE] (#19776)
* Restores Spell Card targetting behaviour (#73706)

## About The Pull Request

Fixes #52946

This has been broken ever since #44112 which apparently removed the proc
in this component which selected a target for performance reasons and
just... didn't replace it with anything else? So it's been bricked ever
since.

In order to restore the removed mouse tracking behaviour I implemented
the pattern used in scoped weapons and the kinesis module. As this was
the third thing I could find to use this code, I abstracted it out into
an object where most of the shared behaviour lives. I tested those
things too and they still seem to do what they used to.

Here it is in action:

https://user-images.githubusercontent.com/7483112/221954852-22244bb1-7c87-452d-a9b0-ebed81c4c1ef.mp4

Because this spell now applies a full screen overlay in order to
function, it's really begging for someone to make some touhou-style art
with cards and patterns around the edge of the screen while you are in
aiming mode, but I'm not going to be the one to make it.

I tidied this component up and refactored it as best I could while I was
reworking it to use a full screen overlay but I am... not totally
confident that it should be a component at all given that it keeps being
created and destroyed. But also it has worked that way for like four
years now, so who am I to say.

Oh yeah also the icon for this spell broke, so I fixed it.

## Why It's Good For The Game

Makes a reasonably terrible wizard spell marginally less bad.
Maybe now that this component works, some other things can use it?
If we make a fourth thing which follows your cursor it won't need to
copy/paste code around.

## Changelog

🆑
fix: Spell Cards from the Wizard spell will now home in somewhat on the
target nearest to your cursor.
fix: The Spell Cards spell now displays the correct icon instead of a
big red "error" text.
/🆑

* Restores Spell Card targetting behaviour

---------

Co-authored-by: Jacquerel <hnevard@gmail.com>
2023-03-11 15:15:26 +00:00