Skip to content

Commit

Permalink
FootClass::Speed is modified by Set_Speed and must not be declared as
Browse files Browse the repository at this point in the history
const
  • Loading branch information
th-otto committed Mar 20, 2024
1 parent ffd4077 commit 7339f8d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions tiberiandawn/foot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ void FootClass::Debug_Dump(MonoClass* mono) const
void FootClass::Set_Speed(int speed)
{
speed &= 0xFF;
((unsigned char&)Speed) = speed;
Speed = speed;
}

/***********************************************************************************************
Expand Down Expand Up @@ -2068,4 +2068,4 @@ COORDINATE FootClass::Likely_Coord(void) const
return (Head_To_Coord());
}
return (Target_Coord());
}
}
4 changes: 2 additions & 2 deletions tiberiandawn/foot.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ class FootClass : public TechnoClass
** This is the "throttle setting" of the unit. It is a fractional value with 0 = stop
** and 255 = full speed.
*/
unsigned char const Speed;
unsigned char Speed;

/*
**
Expand Down Expand Up @@ -320,4 +320,4 @@ class FootClass : public TechnoClass
*/
};

#endif
#endif

0 comments on commit 7339f8d

Please sign in to comment.