summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/console.txt2
-rw-r--r--network.c25
-rw-r--r--rail_gui.c1
-rw-r--r--readme.txt1
-rw-r--r--train_cmd.c8
5 files changed, 18 insertions, 19 deletions
diff --git a/docs/console.txt b/docs/console.txt
index e2908f930..03313b1cf 100644
--- a/docs/console.txt
+++ b/docs/console.txt
@@ -1,6 +1,6 @@
OPENTTD INGAME CONSOLE DOCUMENTATION
====================================
-http://openttd.rulez.org/wiki2/index.php/OpenTTDDevBlackBook
+http://wiki.openttd.org/index.php/OpenTTDDevBlackBook
for detailed information
HOTKEY: BACKQUOTE (aka tilde, the key left to "1")
diff --git a/network.c b/network.c
index dd3cff047..b8df0cb31 100644
--- a/network.c
+++ b/network.c
@@ -951,14 +951,13 @@ static ClientState *AllocClient(SOCKET s)
void NetworkSendReadyPacket()
{
if ((!_network_ready_sent) && (_frame_counter + _network_ready_ahead >= _frame_counter_max)) {
- ReadyPacket *rp = malloc(sizeof(rp));
- ClientState *c = _clients;
+ ReadyPacket rp;
DEBUG(net,1) ("NET: %i] ready packet sent", _frame_counter);
- rp->packet_type = PACKET_TYPE_READY;
- rp->packet_length = sizeof(rp);
- SendBytes(c, rp, sizeof(rp));
+ rp.packet_type = PACKET_TYPE_READY;
+ rp.packet_length = sizeof(rp);
+ SendBytes(_clients, &rp, sizeof(rp));
_network_ready_sent = true;
}
}
@@ -1911,20 +1910,18 @@ NetworkGameList * NetworkGameListItem(uint16 index)
void NetworkGameFillDefaults()
{
NetworkGameInfo * game = &_network_game;
-#if defined(WITH_REV)
- extern char _openttd_revision[];
-#endif
+ #if defined(WITH_REV)
+ extern char _openttd_revision[];
+ #else
+ const char _openttd_revision[] = "norev000";
+ #endif
DEBUG(net, 4) ("[NET][G-Info] setting defaults");
- ttd_strlcpy(game->server_name,"OpenTTD Game",13);
+ ttd_strlcpy(game->server_name, "OpenTTD Game", sizeof(game->server_name));
game->game_password[0]='\0';
game->map_name[0]='\0';
-#if defined(WITH_REV)
- ttd_strlcpy(game->server_revision,_openttd_revision,strlen(_openttd_revision));
-#else
- ttd_strlcpy(game->server_revision,"norev000",strlen("norev000"));
-#endif
+ ttd_strlcpy(game->server_revision, _openttd_revision, sizeof(game->server_revision));
game->game_date=0;
game->map_height=0;
diff --git a/rail_gui.c b/rail_gui.c
index 369936ba0..83ce76da0 100644
--- a/rail_gui.c
+++ b/rail_gui.c
@@ -810,6 +810,7 @@ void ShowBuildRailToolbar(int index, int button)
w = AllocateWindowDesc(_build_rr_desc[index]);
}
+ _remove_button_clicked = false;
if (w != NULL && button >= 0) _build_railroad_button_proc[button](w);
}
diff --git a/readme.txt b/readme.txt
index eaa97b33e..5ee90cc65 100644
--- a/readme.txt
+++ b/readme.txt
@@ -111,6 +111,7 @@ Several important non-standard controls:
* Use Ctrl to place presignals
* Ctrl-d toggles double mode on win32
+* Ingame console. More information at http://wiki.openttd.org/index.php/OpenTTDDevBlackBook
6.0) Configuration File:
diff --git a/train_cmd.c b/train_cmd.c
index 2efd3e03d..998c782e3 100644
--- a/train_cmd.c
+++ b/train_cmd.c
@@ -2253,8 +2253,8 @@ static void ChangeTrainDirRandomly(Vehicle *v)
do {
//I need to buffer the train direction
- if (!v->u.rail.track & 0x40)
- v->direction = (v->direction + _random_dir_change[Random()&3]) & 7;
+ if (!(v->u.rail.track & 0x40))
+ v->direction = (v->direction + _random_dir_change[InteractiveRandom()&3]) & 7;
if (!(v->vehstatus & VS_HIDDEN)) {
BeginVehicleMove(v);
UpdateTrainDeltaXY(v, v->direction);
@@ -2274,13 +2274,13 @@ static void HandleCrashedTrain(Vehicle *v)
CreateEffectVehicleRel(v, 4, 4, 8, EV_CRASHED_SMOKE);
}
- if (state <= 200 && (uint16)(r=Random()) <= 0x2492) {
+ if (state <= 200 && (uint16)(r=InteractiveRandom()) <= 0x2492) {
index = (r * 10 >> 16);
u = v;
do {
if (--index < 0) {
- r = Random();
+ r = InteractiveRandom();
CreateEffectVehicleRel(u,
2 + ((r>>8)&7),