Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FootClass::Speed is modified by Set_Speed and must not be declared as #971

Merged
merged 1 commit into from
Jun 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading