Changeset 9ba9b96 in network-game for common/WorldMap.cpp


Ignore:
Timestamp:
Jan 20, 2014, 4:59:34 PM (11 years ago)
Author:
dportnoy <dmp1488@…>
Branches:
master
Children:
949cf70
Parents:
d998572
Message:

All ids should now be unsigned ints

File:
1 edited

Legend:

Unmodified
Added
Removed
  • common/WorldMap.cpp

    rd998572 r9ba9b96  
    102102// used by the server to create new objects
    103103void WorldMap::addObject(WorldMap::ObjectType t, int x, int y) {
    104    int id;
     104   unsigned int id;
    105105   vector<WorldMap::Object>::iterator it;
    106106
     
    111111      }
    112112
    113       if (it == vctObjects->end())  // if no objects with this id exists
     113      if (it == vctObjects->end())  // if no objects with this id exist
    114114         break;
    115115   }
     
    120120
    121121// used by the client to update object positions or create objects it has not seen before
    122 void WorldMap::updateObject(int id, WorldMap::ObjectType t, int x, int y) {
     122void WorldMap::updateObject(unsigned int id, WorldMap::ObjectType t, int x, int y) {
    123123   vector<WorldMap::Object>::iterator it;
    124124   bool foundObject = false;
     
    157157}
    158158
    159 bool WorldMap::removeObject(int id) {
     159bool WorldMap::removeObject(unsigned int id) {
    160160   vector<WorldMap::Object>::iterator it;
    161161
     
    316316/*** Functions for Object ***/
    317317
    318 WorldMap::Object::Object(int id, ObjectType type, int x, int y) {
     318WorldMap::Object::Object(unsigned int id, ObjectType type, int x, int y) {
    319319   this->type = type;
    320320   this->id = id;
     
    323323}
    324324
    325 WorldMap::Object::Object(int id, ObjectType type, POSITION pos) {
     325WorldMap::Object::Object(unsigned int id, ObjectType type, POSITION pos) {
    326326   this->type = type;
    327327   this->id = id;
Note: See TracChangeset for help on using the changeset viewer.