Building of walls only in network game allowed.

This commit is contained in:
johns 2000-05-11 07:16:11 +00:00
parent 37ed8abfa7
commit 5c7788981b
2 changed files with 19 additions and 6 deletions

View file

@ -490,6 +490,7 @@
<LI>Fixed bug: cancel button, of set pending command didn't work.
<LI>Made fancy building configurable.
<LI>Fixed bug: New network code, did not call win32 init.
<LI>Building of walls only in network game allowed.
<LI>+++
</UL>

View file

@ -28,6 +28,7 @@
#include "upgrade.h"
#include "depend.h"
#include "interface.h"
#include "network.h"
/*----------------------------------------------------------------------------
-- Defines
@ -187,6 +188,17 @@ local int CheckNeedStronghold(const Unit* unit,const ButtonAction* button)
|| HaveUnitTypeByIdent(unit->Player,"unit-fortress") > 0;
}
/**
** Check if network play is enabled.
** Needed for walls, which could only be build in network play.
**
** NOTE: this check could also be moved into intialisation.
*/
local int CheckNetwork(const Unit* unit,const ButtonAction* button)
{
return NetworkFildes!=-1;
}
global int bc_NoWork(const Unit* unit,const ButtonAction* button )
{ return ( unit->Type
&& unit->Type->Building
@ -469,10 +481,9 @@ global ButtonAction AllButtons[] = {
't', "BUILD ~!TOWER",
WORKERS_H
},
// FIXME: wall only in multiplayer!
{ 8, 1, { "icon-human-wall" },
B_Build, 0, "unit-human-wall",
NULL, NULL,
CheckNetwork, NULL,
'w', "BUILD ~!WALL",
WORKERS_H
},
@ -1214,10 +1225,9 @@ global ButtonAction AllButtons[] = {
't', "BUILD ~!TOWER",
WORKERS_O
},
// FIXME: wall only in multiplayer!
{ 8, 1, { "icon-orc-wall" },
B_Build, 0, "unit-orc-wall",
NULL, NULL,
CheckNetwork, NULL,
'w', "BUILD ~!WALL",
WORKERS_O
},
@ -1248,13 +1258,15 @@ global ButtonAction AllButtons[] = {
},
{ 4, 2, { "icon-goblin-alchemist" },
B_Build, 0, "unit-goblin-alchemist",
CheckNeedStronghold, NULL,
// FIXME: CheckNeedStronghold, NULL,
NULL, NULL,
'a', "BUILD GOBLIN ~!ALCHEMIST",
WORKERS_O
},
{ 5, 2, { "icon-ogre-mound" },
B_Build, 0, "unit-ogre-mound",
CheckNeedStronghold, NULL,
// FIXME: CheckNeedStronghold, NULL,
NULL, NULL,
'o', "BUILD ~!OGRE MOUND",
WORKERS_O
},