latest novapolis client for 1.5

--HG--
branch : novattd150
This commit is contained in:
Pavel Stupnikov
2015-03-16 03:20:50 +03:00
parent d201932121
commit e48d2d58e0
69 changed files with 3756 additions and 486 deletions

View File

@@ -26,6 +26,10 @@
#include "signal_func.h"
#include "core/backup_type.hpp"
#include "object_base.h"
#include "window_func.h"
#include "watch_gui.h"
#include "network/network_base.h"
#include "window_func.h"
#include "table/strings.h"
@@ -547,14 +551,19 @@ 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)
{
/* Cost estimation is generally only done when the
* local user presses shift while doing somthing.
* However, in case of incoming network commands,
* map generation or the pause button we do want
* to execute. */
bool estimate_only = _shift_pressed && IsLocalCompany() &&
!_generating_world &&
!(cmd & CMD_NETWORK_COMMAND) &&
(cmd & CMD_ID_MASK) != CMD_PAUSE;
* local user presses shift while constructing somthing.
* However, in case of incoming network commands or
* map generation we do want to execute. */
bool estimate_only = false;
switch (_command_proc_table[cmd & CMD_ID_MASK].type) {
case CMDT_LANDSCAPE_CONSTRUCTION:
case CMDT_VEHICLE_CONSTRUCTION:
estimate_only = _shift_pressed && IsLocalCompany() &&
!_generating_world && !(cmd & CMD_NETWORK_COMMAND);
break;
default:
break; // just to silence warnings
}
/* We're only sending the command, so don't do
* fancy things for 'success'. */
@@ -756,6 +765,23 @@ CommandCost DoCommandPInternal(TileIndex tile, uint32 p1, uint32 p2, uint32 cmd,
if (c != NULL) c->last_build_coordinate = tile;
}
/* Send Tile Number to Watching Company Windows */
WatchCompany *wc;
for(int watching_window = 0; ; watching_window++){
wc = dynamic_cast<WatchCompany*>(FindWindowById(WC_WATCH_COMPANY, watching_window));
if(wc != NULL) wc->OnDoCommand(_current_company, tile);
else break;
}
NetworkClientInfo *ci;
FOR_ALL_CLIENT_INFOS(ci) {
if (ci->client_playas == _current_company) {
wc = dynamic_cast<WatchCompany*>(FindWindowById(WC_WATCH_COMPANYA, ci->client_id));
if (wc != NULL) wc->OnDoCommand(_current_company, tile);
break;
}
}
SubtractMoneyFromCompany(res2);
/* update signals if needed */