Anime-Game-Servers / Grasscutter-Quests

A server software implementation, ineroperable with a certain anime game client. The code in this repository is fully custom made for edyoucational purposes and future preservation, no copyrighted code is allowed in this repository.
https://grasscutters.xyz/grasscutter
GNU Affero General Public License v3.0
133 stars 31 forks source link

Update ActionLoseHP.java to ignore Infinite CUR_HP #123

Closed scooterboo closed 7 months ago

scooterboo commented 7 months ago

Description

In dungeon 1114 (scene 20104), when the floor in front of the statue is activated (/entity 3014 state201), the player's health becomes NaN:

image

This is because part of the damage equation uses the floor's current HP, which is Infinite. We set the current HP of invincible objects to Positive infinity when they are created.

amountByCasterCurrentHPRatio is zero, FIGHT_PROP_CUR_HP is Infinity. Multiplying zero by Infinity results in NaN. Adding anything to NaN is NaN

Type of changes

Checklist:

sonarcloud[bot] commented 7 months ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud