diff --git a/src/combat.cpp b/src/combat.cpp index a4483879c5e..db94e0dcb16 100644 --- a/src/combat.cpp +++ b/src/combat.cpp @@ -513,7 +513,7 @@ int32_t objDamage(BASE_OBJECT *psObj, unsigned damage, unsigned originalhp, WEAP { psDroid->shieldPoints -= actualDamage; actualDamage = 0; - } + } else { actualDamage -= psDroid->shieldPoints; @@ -527,7 +527,7 @@ int32_t objDamage(BASE_OBJECT *psObj, unsigned damage, unsigned originalhp, WEAP if (weaponSubClass != WSC_FLAME && weaponSubClass != WSC_COMMAND && - PERCENT(psDroid->shieldPoints, droidGetMaxShieldPoints(psDroid)) > 25) + PERCENT(psDroid->shieldPoints, droidGetMaxShieldPoints(psDroid)) > 25) { Vector3i dv; dv.y = psDroid->pos.z; diff --git a/src/display3d.cpp b/src/display3d.cpp index 1092ef7fdb5..31614d4d777 100644 --- a/src/display3d.cpp +++ b/src/display3d.cpp @@ -3473,16 +3473,16 @@ static void queueDroidPowerBarsRects(DROID *psDroid, bool drawBox, BatchedMultiR batchedMultiRectRenderer.addRect(PIERECT_DrawRequest(psDroid->sDisplay.screenX - psDroid->sDisplay.screenR, psDroid->sDisplay.screenY + psDroid->sDisplay.screenR + 3, psDroid->sDisplay.screenX - psDroid->sDisplay.screenR + damage, psDroid->sDisplay.screenY + psDroid->sDisplay.screenR + 4, powerCol), rectGroup); batchedMultiRectRenderer.addRect(PIERECT_DrawRequest(psDroid->sDisplay.screenX - psDroid->sDisplay.screenR, psDroid->sDisplay.screenY + psDroid->sDisplay.screenR + 4, psDroid->sDisplay.screenX - psDroid->sDisplay.screenR + damage, psDroid->sDisplay.screenY + psDroid->sDisplay.screenR + 5, powerColShadow), rectGroup); batchedMultiRectRenderer.addRect(PIERECT_DrawRequest( - psDroid->sDisplay.screenX - psDroid->sDisplay.screenR - 3, - psDroid->sDisplay.screenY + psDroid->sDisplay.screenR, - psDroid->sDisplay.screenX - psDroid->sDisplay.screenR - 1, - psDroid->sDisplay.screenY + psDroid->sDisplay.screenR - shields, WZCOL_LBLUE), + psDroid->sDisplay.screenX - psDroid->sDisplay.screenR - 3, + psDroid->sDisplay.screenY + psDroid->sDisplay.screenR, + psDroid->sDisplay.screenX - psDroid->sDisplay.screenR - 1, + psDroid->sDisplay.screenY + psDroid->sDisplay.screenR - shields, WZCOL_LBLUE), rectGroup); batchedMultiRectRenderer.addRect(PIERECT_DrawRequest( - psDroid->sDisplay.screenX - psDroid->sDisplay.screenR - 2, - psDroid->sDisplay.screenY + psDroid->sDisplay.screenR, - psDroid->sDisplay.screenX - psDroid->sDisplay.screenR, - psDroid->sDisplay.screenY + psDroid->sDisplay.screenR - shields, WZCOL_BLACK), + psDroid->sDisplay.screenX - psDroid->sDisplay.screenR - 2, + psDroid->sDisplay.screenY + psDroid->sDisplay.screenR, + psDroid->sDisplay.screenX - psDroid->sDisplay.screenR, + psDroid->sDisplay.screenY + psDroid->sDisplay.screenR - shields, WZCOL_BLACK), rectGroup); } diff --git a/src/droid.cpp b/src/droid.cpp index 3d044d538ca..43e0308fa1e 100644 --- a/src/droid.cpp +++ b/src/droid.cpp @@ -959,7 +959,7 @@ void droidUpdate(DROID *psDroid) void droidUpdateShields(DROID *psDroid) { - if (hasCommander(psDroid) || psDroid->droidType == DROID_COMMAND) + if (hasCommander(psDroid) || psDroid->droidType == DROID_COMMAND) { if (psDroid->shieldPoints < 0) { @@ -1001,7 +1001,7 @@ UDWORD droidCalculateShieldInterruptRegenTime(const DROID *psDroid) return DROID_INITIAL_SHIELD_INTERRUPT_REGEN_TIME - (DROID_SHIELD_INTERRUPT_REGEN_TIME_DEC * getDroidLevel(psDroid)); } -UDWORD droidGetMaxShieldPoints(const DROID *psDroid) +UDWORD droidGetMaxShieldPoints(const DROID *psDroid) { UDWORD percent = psDroid->originalBody / 100; return percent * (DROID_INITIAL_SHILED_POINTS_PERCENT + DROID_ADDITVE_SHILED_POINTS_PERCENT * getDroidLevel(psDroid));