Skip to content

Commit 8042fdc

Browse files
authored
Addresses oxwhirl#72
1 parent fcdd0d3 commit 8042fdc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

smac/env/starcraft2/starcraft2.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -742,7 +742,7 @@ def reward_battle(self):
742742
delta_enemy += prev_health - e_unit.health - e_unit.shield
743743

744744
if self.reward_only_positive:
745-
reward = abs(delta_enemy + delta_deaths) # shield regeneration
745+
reward = max(0, delta_enemy + delta_deaths) # shield regeneration
746746
else:
747747
reward = delta_enemy + delta_deaths - delta_ally
748748

0 commit comments

Comments
 (0)