mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-30 03:23:48 +01:00
Fixed an issue where bladeburner would miscalculate hospitalization cost.
This commit is contained in:
parent
afc1347d3a
commit
bd172434d1
@ -259,5 +259,6 @@ export const CONSTANTS: IMap<any> = {
|
|||||||
* Fix error message throw undefined variable error
|
* Fix error message throw undefined variable error
|
||||||
* City hall now has some generic text if you can't create a corp yet.
|
* City hall now has some generic text if you can't create a corp yet.
|
||||||
* Deleting a file without extension now returns an appropriate error message.
|
* Deleting a file without extension now returns an appropriate error message.
|
||||||
|
* Fixed an issue where bladeburner would miscalculate the cost of hospitalization.
|
||||||
`,
|
`,
|
||||||
}
|
}
|
@ -19,7 +19,6 @@ export function getHospitalizationCost(p: IPlayer): number {
|
|||||||
export function calculateHospitalizationCost(p: IPlayer, damage: number): number {
|
export function calculateHospitalizationCost(p: IPlayer, damage: number): number {
|
||||||
const oldhp = p.hp;
|
const oldhp = p.hp;
|
||||||
p.hp -= damage
|
p.hp -= damage
|
||||||
if (p.hp < 0) p.hp = 0;
|
|
||||||
const cost = getHospitalizationCost(p);
|
const cost = getHospitalizationCost(p);
|
||||||
p.hp = oldhp;
|
p.hp = oldhp;
|
||||||
return cost;
|
return cost;
|
||||||
|
Loading…
Reference in New Issue
Block a user