Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 1708


Ignore:
Timestamp:
Sep 4, 2008, 10:07:14 PM (16 years ago)
Author:
scheusso
Message:

small error in classid.cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/network/src/network/packet/ClassID.cc

    r1705 r1708  
    2121  assert(getSize());
    2222  data_=new unsigned char[ getSize() ];
    23   if(!data_)
    24     return;
     23  assert(data_);
    2524  *(packet::ENUM::Type *)&data_[ _PACKETID ] = packet::ENUM::ClassID;
    2625  *(unsigned int *)&data_[ _CLASSID ] = classID;
     
    3231  : PacketContent(data, clientID)
    3332{
    34   memcpy( (void *)&classNameLength_, &data[ sizeof(ENUM::Type) + sizeof(int) ], sizeof(classNameLength_) );
     33  memcpy( (void *)&classNameLength_, &data[ _CLASSNAMELENGTH ], sizeof(classNameLength_) );
    3534}
    3635
     
    4443
    4544unsigned int ClassID::getSize() const{
    46   return sizeof(network::packet::ENUM::Type) + sizeof(int) + classNameLength_;
     45  return sizeof(network::packet::ENUM::Type) + 2*sizeof(unsigned int) + classNameLength_;
    4746}
    4847
Note: See TracChangeset for help on using the changeset viewer.