Initial uses of scope guard logging.

This commit is contained in:
Jonathan G Rennison
2016-02-17 19:45:24 +00:00
parent 5cf2b04f6a
commit ae6e43c5fa
2 changed files with 13 additions and 2 deletions

View File

@@ -28,6 +28,7 @@
#include "object_base.h"
#include "newgrf_text.h"
#include "string_func.h"
#include "scope_info.h"
#include "table/strings.h"
@@ -455,6 +456,8 @@ CommandCost DoCommand(const CommandContainer *container, DoCommandFlag flags)
*/
CommandCost DoCommand(TileIndex tile, uint32 p1, uint32 p2, DoCommandFlag flags, uint32 cmd, const char *text)
{
SCOPE_INFO_FMT([=], "DoCommand: tile: %dx%d, p1: 0x%X, p2: 0x%X, flags: 0x%X, company: %s, cmd: 0x%X (%s)", TileX(tile), TileY(tile), p1, p2, flags, DumpCompanyInfo(_current_company), cmd, GetCommandName(cmd));
CommandCost res;
/* Do not even think about executing out-of-bounds tile-commands */
@@ -548,6 +551,8 @@ bool DoCommandP(const CommandContainer *container, bool my_cmd)
*/
bool DoCommandP(TileIndex tile, uint32 p1, uint32 p2, uint32 cmd, CommandCallback *callback, const char *text, bool my_cmd)
{
SCOPE_INFO_FMT([=], "DoCommandP: tile: %dx%d, p1: 0x%X, p2: 0x%X, company: %s, cmd: 0x%X (%s), my_cmd: %d", TileX(tile), TileY(tile), p1, p2, DumpCompanyInfo(_current_company), cmd, GetCommandName(cmd), my_cmd);
/* Cost estimation is generally only done when the
* local user presses shift while doing somthing.
* However, in case of incoming network commands,