Changeset 227baaa in network-game for common/Player.cpp


Ignore:
Timestamp:
Apr 23, 2013, 1:43:13 AM (12 years ago)
Author:
dportnoy <dmp1488@…>
Branches:
master
Children:
d211210
Parents:
a1a3bd5
Message:

Fixed some syntax errors related to the player move method

File:
1 edited

Legend:

Unmodified
Added
Removed
  • common/Player.cpp

    ra1a3bd5 r227baaa  
    8383}
    8484
    85 bool Player::move(WorldMap map) {
     85bool Player::move(WorldMap *map) {
    8686   int speed = 100; // pixels per second
    8787   unsigned long long curTime = getCurrentMillis();
     
    102102         newPos.y = int(pos.y + sin(angle)*pixels);
    103103
    104          switch(map.getElement(newPos.x/25, newPos.y/25)) {
    105             case WorldMap.TerrainType.TERRAIN_OCEAN:
    106             case WorldMap.TerrainType.TERRAIN_ROCK:
    107                target.x = pos.x;
    108                target.y = pos.y;
    109                moveCanceled = true;
    110                break;
     104         switch(map->getElement(newPos.x/25, newPos.y/25)) {
     105         case WorldMap::TERRAIN_NONE:
     106         case WorldMap::TERRAIN_ROCK:
     107            target.x = pos.x;
     108            target.y = pos.y;
     109            moveCanceled = true;
     110            break;
    111111         }
    112112      }
Note: See TracChangeset for help on using the changeset viewer.