Skip to content

Commit

Permalink
Player: Check for status greater than 0,
Browse files Browse the repository at this point in the history
when adding or subtracting status, since 0 status can't be added or subtracted.
  • Loading branch information
tchalvak committed May 11, 2016
1 parent db3452d commit 451741e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions deploy/lib/data/Player.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public function id() {
public function addStatus($p_status) {
$status = self::validStatus($p_status);

if ($status && !$this->hasStatus($status)) {
if ($status > 0 && !$this->hasStatus($status)) {
if (gettype($this->status | $status) !== 'integer') {
throw new \InvalidArgumentException('invalid type for status');
}
Expand All @@ -159,7 +159,7 @@ public function addStatus($p_status) {
public function subtractStatus($p_status) {
$status = self::validStatus($p_status);

if ($status && $this->hasStatus($status)) {
if ($status > 0 && $this->hasStatus($status)) {
if (gettype($this->status & ~$status) !== 'integer') {
throw new \InvalidArgumentException('invalid type for status');
}
Expand Down

0 comments on commit 451741e

Please sign in to comment.