Codechange: Un-bitstuff the remaining on-map commands.

This commit is contained in:
Michael Lutz
2021-11-21 23:03:44 +01:00
parent c6d7b98808
commit 58cff7b081
24 changed files with 80 additions and 96 deletions

View File

@@ -3468,23 +3468,21 @@ void InitializeSpriteSorter()
* Scroll players main viewport.
* @param flags type of operation
* @param tile tile to center viewport on
* @param p1 ViewportScrollTarget of scroll target
* @param p2 company or client id depending on the target
* @param text unused
* @param target ViewportScrollTarget of scroll target
* @param ref company or client id depending on the target
* @return the cost of this operation or an error
*/
CommandCost CmdScrollViewport(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text)
CommandCost CmdScrollViewport(DoCommandFlag flags, TileIndex tile, ViewportScrollTarget target, uint32 ref)
{
if (_current_company != OWNER_DEITY) return CMD_ERROR;
ViewportScrollTarget target = (ViewportScrollTarget)p1;
switch (target) {
case VST_EVERYONE:
break;
case VST_COMPANY:
if (_local_company != (CompanyID)p2) return CommandCost();
if (_local_company != (CompanyID)ref) return CommandCost();
break;
case VST_CLIENT:
if (_network_own_client_id != (ClientID)p2) return CommandCost();
if (_network_own_client_id != (ClientID)ref) return CommandCost();
break;
default:
return CMD_ERROR;