Changeset b81cea1 in network-game for common


Ignore:
Timestamp:
May 24, 2013, 2:07:50 AM (12 years ago)
Author:
dportnoy <dmp1488@…>
Branches:
master
Children:
b07eeac
Parents:
23559e7
Message:

Fix a bug that prevents the player from moving anywhere

Location:
common
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • common/Player.cpp

    r23559e7 rb81cea1  
    9999      double angle = atan2(target.y-pos.y, target.x-pos.x);
    100100      float dist = sqrt(pow(target.x-pos.x, 2) + pow(target.y-pos.y, 2));
    101       FLOAT_POSITION newPos;
    102101
    103102      if (dist <= pixels) {
    104          newPos.x = target.x;
    105          newPos.y = target.y;
     103         pos.x = target.x;
     104         pos.y = target.y;
    106105      }else {
    107          newPos.x = pos.x + cos(angle)*pixels;
    108          newPos.y = pos.y + sin(angle)*pixels;
     106         pos.x = pos.x + cos(angle)*pixels;
     107         pos.y = pos.y + sin(angle)*pixels;
    109108      }
    110109   }
  • common/WorldMap.cpp

    r23559e7 rb81cea1  
    209209               }
    210210            }else {
    211                // load objects
     211               // load structure
    212212
    213213               int x, y, type;
Note: See TracChangeset for help on using the changeset viewer.