Skip to content

Commit

Permalink
fix: now you cannot drop egg when you dont have any
Browse files Browse the repository at this point in the history
  • Loading branch information
KalinZhang committed Apr 20, 2021
1 parent a7f08da commit 3ad23b1
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion include/json
Submodule json updated from 7126d8 to 1cd5ab
2 changes: 1 addition & 1 deletion include/record-sdk
2 changes: 1 addition & 1 deletion tools/vcpkg
Submodule vcpkg updated 1359 files
2 changes: 1 addition & 1 deletion world.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ void World::read_from_team_action(Team team, nlohmann::json detail) {
current_player->set_status(new_status);
}
//--------- handle egg placement ---------
if (!player_action["drop"].is_null()) {
if (!player_action["drop"].is_null() && current_player->egg() != -1) {
const double radian = player_action["drop"];
// resolve if two eggs to be placed at conflicted posistion
double mindis = EGG_RADIUS + std::min(EGG_RADIUS, PLAYER_RADIUS);
Expand Down

0 comments on commit 3ad23b1

Please sign in to comment.