Merge remote-tracking branch 'upstream/master' into 13.0

This commit is contained in:
Pavel Stupnikov
2022-11-26 22:16:25 +04:00
508 changed files with 14617 additions and 9750 deletions
+7 -8
View File
@@ -92,6 +92,7 @@
#include "command_func.h"
#include "network/network_func.h"
#include "framerate_type.h"
#include "viewport_cmd.h"
#include <forward_list>
#include <map>
@@ -3887,25 +3888,23 @@ void InitializeSpriteSorter()
/**
* Scroll players main viewport.
* @param tile tile to center viewport on
* @param flags type of operation
* @param p1 ViewportScrollTarget of scroll target
* @param p2 company or client id depending on the target
* @param text unused
* @param tile tile to center viewport on
* @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(TileIndex tile, DoCommandFlag flags, 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;