Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Damage Coeff Instancing #1565

Merged
merged 1 commit into from
Oct 21, 2023
Merged

Conversation

LanceSmites328
Copy link
Contributor

@LanceSmites328 LanceSmites328 commented Oct 21, 2023

About The Pull Request

Lists defined in a type's definition, see:

/mob/living/simple_animal/hostile/abnormality
	...
	var/list/work_chances = list(
		ABNORMALITY_WORK_INSTINCT = list(50, 55, 60, 65, 70),
		ABNORMALITY_WORK_INSIGHT = list(50, 55, 60, 65, 70),
		ABNORMALITY_WORK_ATTACHMENT = list(50, 55, 60, 65, 70),
		ABNORMALITY_WORK_REPRESSION = list(50, 55, 60, 65, 70)
		)
	...

Are kept and shared between all instances of the type, including ones actually created into the world and ones yet to be made. This means if you, for example, change a Sweeper's damage resistance to White Damage, it would change ALL Sweeper's White Resist. Simultaneously. The way to prevent this is to simply "make a new list" by setting all lists that are created to a Copy() of what they start as in Initialize().

This PR does SPECIFICALLY THAT for damage_coeff on all simple_animals

Why It's Good For The Game

Prevents the Overmind.

Changelog

🆑
fix: simple_animal mobs sharing resistances
/:cl:

@LanceSmites328 LanceSmites328 added Red Label High importance issue/pull request. Fix There was a bug, and we fixed it! labels Oct 21, 2023
Copy link
Contributor

@Kitsunemitsu Kitsunemitsu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved.

@LanceSmites328 LanceSmites328 merged commit 7e0697c into vlggms:master Oct 21, 2023
10 checks passed
@LanceSmites328 LanceSmites328 deleted the List-Instancing branch October 21, 2023 06:05
vampirebat74 pushed a commit to vampirebat74/lobotomy-corp13 that referenced this pull request May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fix There was a bug, and we fixed it! Red Label High importance issue/pull request.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants