Changeset - r26845:b2f726007f76
[Not reviewed]
master
0 1 0
SamuXarick - 21 months ago 2023-02-01 18:48:39
43006711+SamuXarick@users.noreply.github.com
Cleanup: [Script] Pass new_rating directly to CmdTownRating (#10441)
1 file changed with 1 insertions and 4 deletions:
0 comments (0 inline, 0 general)
src/script/api/script_town.cpp
Show inline comments
 
@@ -358,10 +358,7 @@
 
	int16 new_rating = Clamp(t->ratings[company] + delta, RATING_MINIMUM, RATING_MAXIMUM);
 
	if (new_rating == t->ratings[company]) return false;
 

	
 
	uint16 p2 = 0;
 
	memcpy(&p2, &new_rating, sizeof(p2));
 

	
 
	return ScriptObject::Command<CMD_TOWN_RATING>::Do(town_id, (::CompanyID)company_id, p2);
 
	return ScriptObject::Command<CMD_TOWN_RATING>::Do(town_id, (::CompanyID)company_id, new_rating);
 
}
 

	
 
/* static */ int ScriptTown::GetAllowedNoise(TownID town_id)
0 comments (0 inline, 0 general)