Merge branch 'master' into jgrpp

# Conflicts:
#	src/music.cpp
#	src/script/api/script_company.cpp
#	src/script/api/script_event_types.cpp
#	src/script/api/script_group.cpp
#	src/script/api/script_object.cpp
#	src/script/api/script_road.cpp
This commit is contained in:
Jonathan G Rennison
2023-03-11 00:06:13 +00:00
61 changed files with 844 additions and 52 deletions

View File

@@ -772,10 +772,8 @@ public:
*/
bool SetPosition(int position)
{
assert(position >= 0);
assert(this->count <= this->cap ? (position == 0) : (position + this->cap <= this->count));
uint16 old_pos = this->pos;
this->pos = position;
this->pos = Clamp(position, 0, std::max(this->count - this->cap, 0));
return this->pos != old_pos;
}
@@ -794,7 +792,7 @@ public:
case SS_BIG: difference *= this->cap; break;
default: break;
}
return this->SetPosition(Clamp(this->pos + difference, 0, std::max(this->count - this->cap, 0)));
return this->SetPosition(this->pos + difference);
}
/**