(svn r16352) -Codechange: use PoolItem::GetIfValid() instead of PoolItem::IsValidID() and PoolItem::Get()

This commit is contained in:
smatz
2009-05-18 16:21:28 +00:00
parent 5fe906e149
commit 8808f3beea
35 changed files with 201 additions and 305 deletions

View File

@@ -314,10 +314,8 @@ static bool IsUniqueWaypointName(const char *name)
*/
CommandCost CmdRenameWaypoint(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
{
if (!Waypoint::IsValidID(p1)) return CMD_ERROR;
Waypoint *wp = Waypoint::Get(p1);
if (!CheckOwnership(wp->owner)) return CMD_ERROR;
Waypoint *wp = Waypoint::GetIfValid(p1);
if (wp == NULL || !CheckOwnership(wp->owner)) return CMD_ERROR;
bool reset = StrEmpty(text);