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

changeAttribute: don't reduce hitpoints of immortal npcs #631

Merged
merged 1 commit into from
May 17, 2024

Conversation

thokkat
Copy link
Contributor

@thokkat thokkat commented May 16, 2024

The orc in the new mine who makes the Ulu-Mulu would have his health reduced instead of increased when taking his medicine. This is due to a script bug giving him the wrong guild and making this check fail.

	if (C_NpcIsOrc(self))
	{
		self.attribute[ATR_HITPOINTS] = self.attribute[ATR_HITPOINTS_MAX];
	}
	else
	{
		Npc_ChangeAttribute	(self,ATR_HITPOINTS,-self.attribute[ATR_HITPOINTS_MAX]);
	};

In vanilla death is prevented by immortality. OG checks immortality only when damage is dealt. This check is now moved to Npc::changeAttribute like it was done for godmode.

@Try Try merged commit ad66816 into Try:master May 17, 2024
1 check passed
@Try
Copy link
Owner

Try commented May 17, 2024

LGTM, thanks @thokkat !

jeduardobras pushed a commit to jeduardobras/OpenGothic that referenced this pull request May 22, 2024
@thokkat thokkat deleted the invincible branch May 26, 2024 21:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants