diff options
author | smatz <smatz@openttd.org> | 2009-05-18 16:21:28 +0000 |
---|---|---|
committer | smatz <smatz@openttd.org> | 2009-05-18 16:21:28 +0000 |
commit | 8808f3beea881af5652716c883a21c8031b5e390 (patch) | |
tree | bc14c65d1e66c407b72d254fc926d105eea2f1e4 /src/command.cpp | |
parent | 5fe906e14992f7a301ae94c357e80af076ab7a63 (diff) | |
download | openttd-8808f3beea881af5652716c883a21c8031b5e390.tar.xz |
(svn r16352) -Codechange: use PoolItem::GetIfValid() instead of PoolItem::IsValidID() and PoolItem::Get()
Diffstat (limited to 'src/command.cpp')
-rw-r--r-- | src/command.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/command.cpp b/src/command.cpp index b80a4e8b1..2ad8e1416 100644 --- a/src/command.cpp +++ b/src/command.cpp @@ -590,8 +590,9 @@ bool DoCommandP(TileIndex tile, uint32 p1, uint32 p2, uint32 cmd, CommandCallbac DEBUG(desync, 1, "cmd: %08x; %08x; %1x; %06x; %08x; %08x; %04x; %s\n", _date, _date_fract, (int)_current_company, tile, p1, p2, cmd & ~CMD_NETWORK_COMMAND, text); /* update last build coordinate of company. */ - if (tile != 0 && Company::IsValidID(_current_company)) { - Company::Get(_current_company)->last_build_coordinate = tile; + if (tile != 0) { + Company *c = Company::GetIfValid(_current_company); + if (c != NULL) c->last_build_coordinate = tile; } /* Actually try and execute the command. If no cost-type is given |