Fixed Explosions + external Damage completely blending a vehicle#2062
Fixed Explosions + external Damage completely blending a vehicle#2062SnailPerson wants to merge 11 commits intoDonBruce64:masterfrom
Conversation
|
@DonBruce64 done, let me get one final test in before commit |
|
dont merge yet, works but vehicles get very little damage now, will sue out why |
|
@DonBruce64 why revert commit on 1.21? And what issues? |
|
should I maybe add an external explosion modifier |
|
"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. |
|
@DonBruce64 oh sorry, I did not see your comment until now.. I went ahead and added a separate explosion damage config. |
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 |
|
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. |
check if damage is explosive, then only apply to core vehicle and skip dmg forwarding