summaryrefslogtreecommitdiff
path: root/src/waypoint.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-12-28 14:37:19 +0000
committerrubidium <rubidium@openttd.org>2008-12-28 14:37:19 +0000
commit87e5a8b52bf2f200467d65c1e17fd79548d31129 (patch)
tree36bbbb5d389d41119ee184607bc012666dda7812 /src/waypoint.cpp
parent53679122af1e0a68bbe4e9c1f73526dd7e118df6 (diff)
downloadopenttd-87e5a8b52bf2f200467d65c1e17fd79548d31129.tar.xz
(svn r14754) -Codechange: get rid of _cmd_text and just pass it as (optional) parameter.
Diffstat (limited to 'src/waypoint.cpp')
-rw-r--r--src/waypoint.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/waypoint.cpp b/src/waypoint.cpp
index cc606acec..a08e543c3 100644
--- a/src/waypoint.cpp
+++ b/src/waypoint.cpp
@@ -190,7 +190,7 @@ void AfterLoadWaypoints()
* @todo When checking for the tile slope,
* distingush between "Flat land required" and "land sloped in wrong direction"
*/
-CommandCost CmdBuildTrainWaypoint(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
+CommandCost CmdBuildTrainWaypoint(TileIndex tile, uint32 flags, uint32 p1, uint32 p2, const char *text)
{
Waypoint *wp;
Slope tileh;
@@ -352,7 +352,7 @@ CommandCost RemoveTrainWaypoint(TileIndex tile, uint32 flags, bool justremove)
* @param p2 unused
* @return cost of operation or error
*/
-CommandCost CmdRemoveTrainWaypoint(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
+CommandCost CmdRemoveTrainWaypoint(TileIndex tile, uint32 flags, uint32 p1, uint32 p2, const char *text)
{
return RemoveTrainWaypoint(tile, flags, true);
}
@@ -379,18 +379,18 @@ static bool IsUniqueWaypointName(const char *name)
* @param p2 unused
* @return cost of operation or error
*/
-CommandCost CmdRenameWaypoint(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
+CommandCost CmdRenameWaypoint(TileIndex tile, uint32 flags, uint32 p1, uint32 p2, const char *text)
{
if (!IsValidWaypointID(p1)) return CMD_ERROR;
Waypoint *wp = GetWaypoint(p1);
if (!CheckOwnership(wp->owner)) return CMD_ERROR;
- bool reset = StrEmpty(_cmd_text);
+ bool reset = StrEmpty(text);
if (!reset) {
- if (strlen(_cmd_text) >= MAX_LENGTH_WAYPOINT_NAME_BYTES) return CMD_ERROR;
- if (!IsUniqueWaypointName(_cmd_text)) return_cmd_error(STR_NAME_MUST_BE_UNIQUE);
+ if (strlen(text) >= MAX_LENGTH_WAYPOINT_NAME_BYTES) return CMD_ERROR;
+ if (!IsUniqueWaypointName(text)) return_cmd_error(STR_NAME_MUST_BE_UNIQUE);
}
if (flags & DC_EXEC) {
@@ -399,7 +399,7 @@ CommandCost CmdRenameWaypoint(TileIndex tile, uint32 flags, uint32 p1, uint32 p2
if (reset) {
MakeDefaultWaypointName(wp); // sets wp->name = NULL
} else {
- wp->name = strdup(_cmd_text);
+ wp->name = strdup(text);
}
UpdateWaypointSign(wp);