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

[fixed] Don't damage items held by teammates #2172

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mugg91
Copy link
Contributor

@mugg91 mugg91 commented Nov 20, 2024

Status

  • ON HOLD
  • I have to test for keg and ballista bomb bolts.

Description

[changed/fixed] Rocks from own catapult don't hurt item held by teammate
[changed/fixed] Ballista Bolt from own ballista doesn't hurt item held by teammate
[changed/fixed] Own Drill doesn't hurt item held by teammate
[changed/fixed] Own Bomb explosion doesn't hurt item held by teammate

Fixes #2170
Might fix some symptoms described here #1267

This PR makes it so own damage sources (bomb explosion, drill, ballista bolt, catapult rocks) don't hurt own held items (log, fishy, chicken, enemy corpse, enemy crate, etc.).

I removed this code from Rock.as and BallistaBolt.as:

	CBlob@ carrier = blob.getCarriedBlob();

	if (carrier !is null)
		if (carrier.hasTag("player")
		        && (this.getTeamNum() == carrier.getTeamNum() || blob.hasTag("temp blob")))
			return false;

This code doesn't seem to serve any purpose. It basicly means, if blue player A holds red player B, then player A doesn't take damage from red catapult rocks. The only time a player can hold another player is when they are dead, but then they get untagged "player" so this code never even runs. Let me know if it does serve any purpose, though.

Tested in offline, should work in online.

Reproduction

You can put a chicken in your catapult, then try to drill it or place a bomb or shoot with another catapult at it.
Prior to this PR, it takes damage, after this PR it doesn't.

@Vam-Jam Vam-Jam marked this pull request as draft November 23, 2024 12:29
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.

Stones from catapult can damage chicken in hand
1 participant