Skip to content

Commit

Permalink
Update Market.php
Browse files Browse the repository at this point in the history
Fixed the AcceptOffer function to not go out of bounds on the $village array
ccjensen931 authored Mar 1, 2019
1 parent 08b111d commit 7b5203b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion GameEngine/Market.php
Original file line number Diff line number Diff line change
@@ -242,7 +242,7 @@ private function acceptOffer($get)
}

// We don't have enough resources
if($infoarray['wamt'] > ([$village->awood, $village->aclay, $village->airon, $village->acrop])[$infoarray['wtype']])
if($infoarray['wamt'] > ([$village->awood, $village->aclay, $village->airon, $village->acrop])[$infoarray['wtype'] - 1])
{
header("Location: build.php?id=".$get['id']."&t=1&e1");
exit;

0 comments on commit 7b5203b

Please sign in to comment.