Skip to content

Commit

Permalink
Addresses oxwhirl#72
Browse files Browse the repository at this point in the history
  • Loading branch information
douglasrizzo authored Jul 9, 2021
1 parent fcdd0d3 commit 8042fdc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion smac/env/starcraft2/starcraft2.py
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,7 @@ def reward_battle(self):
delta_enemy += prev_health - e_unit.health - e_unit.shield

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

Expand Down

0 comments on commit 8042fdc

Please sign in to comment.