Skip to content

Fixed Explosions + external Damage completely blending a vehicle#2062

Open
SnailPerson wants to merge 11 commits intoDonBruce64:masterfrom
SnailPerson:patch-7
Open

Fixed Explosions + external Damage completely blending a vehicle#2062
SnailPerson wants to merge 11 commits intoDonBruce64:masterfrom
SnailPerson:patch-7

Conversation

@SnailPerson
Copy link
Contributor

check if damage is explosive, then only apply to core vehicle and skip dmg forwarding

@SnailPerson
Copy link
Contributor Author

@DonBruce64 done, let me get one final test in before commit

@SnailPerson
Copy link
Contributor Author

dont merge yet, works but vehicles get very little damage now, will sue out why

@SnailPerson
Copy link
Contributor Author

@DonBruce64 why revert commit on 1.21? And what issues?
*I checked code, MC really seems to only apply little damage to the vehicle, 19 compared to 80 to the player

@SnailPerson
Copy link
Contributor Author

should I maybe add an external explosion modifier
externalExplosionDamageFactor in config, times factor, default 3.0?

@DonBruce64
Copy link
Owner

"why revert commit on 1.21? And what issues?" So for that logic there, the system will attack all hitboxes that the system sees. If you issue the break statement, it will only attack the first box in the list. You'd want to be assured that the box it attacks is a vehicle hitbox, not a part hitbox, lest the explosion damage the part.

As to the damage factor, that could be due to distance. If it picks a box further away from the TNT. What you'd probably want to do is find the closest vehicle hitbox to the source of the explosion and attack that one.

@SnailPerson
Copy link
Contributor Author

@DonBruce64 oh sorry, I did not see your comment until now.. I went ahead and added a separate explosion damage config.

@SnailPerson
Copy link
Contributor Author

SnailPerson commented Mar 16, 2026

"why revert commit on 1.21? And what issues?" So for that logic there, the system will attack all hitboxes that the system sees. If you issue the break statement, it will only attack the first box in the list. You'd want to be assured that the box it attacks is a vehicle hitbox, not a part hitbox, lest the explosion damage the part.

As to the damage factor, that could be due to distance. If it picks a box further away from the TNT. What you'd probably want to do is find the closest vehicle hitbox to the source of the explosion and attack that one.

in regards to this, its not due to distance. The code loops through hitboxes, on the first intersecting hitbox, it applies one explosion damage call. Low damage is coming from the incoming explosion amount itself, not from picking a bad hitbox

@DonBruce64
Copy link
Owner

Right. But in this case you want to make sure it doesn't pick a part hitbox as an intersecting since that part might not forward damage to the vehicle. Given the issue thoughts, one should probably check to see if the hitbox is for a part or vehicle before continuing. I'm pretty sure that list contains vehicle and part hitboxes together, so one should probably check if the hitbox is a not-part hitbox before continuing.

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