11 changes: 11 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
2012-03-13: Version 3.1_beta6
* General:
* Fix: Make VTOLs rearm on rearming pads, not beside them (ticket:3285, commit:b4ad988996732c0266be62a301b9fb0a66940ad1)
* Fix: Make building on a tile only accessible diagonally work (ticket:3215, commit:c831b5b87a6188432bee2cd2ea15c3413fdc2ec4)
* Multiplayer:
* Fix: Make it work again (ticket:3281, commit:b7d07f663b4781a32e56b97716266b6db0583d50)
* UI:
* Fix: Make setting the camera position by right-clicking the minimap work again (ticket:3283, commit:91614562b0969c47ffed7020caa1e16c8ede5823)
* Graphics:
* Fix: Make VTOL rearming pads stay above the ground (ticket:702, commit:071d08fc16dcca48ae070a6044686034670411f3)

2012-03-13: Version 3.1_beta5
* General:
* Change: Adjust the burning time of destroyed oil derricks by the percentage they were completed (commit:f6ddbf1878ff2a387c4be95449d8a7835c18ebd8)
Expand Down
4 changes: 2 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
AC_PREREQ([2.56])
AC_INIT([Warzone 2100],[3.1git],[http://wz2100.net/],[warzone2100])
AC_INIT([Warzone 2100],[3.1_beta6],[http://wz2100.net/],[warzone2100])

AM_INIT_AUTOMAKE([1.10 tar-ustar])

Expand Down Expand Up @@ -262,7 +262,7 @@ AS_IF([test "x$enable_sound" != "xyes"],[
# Add later for stricter checking: -Wextra -Wmissing-declarations -Wstrict-prototypes
AC_ARG_ENABLE([debug],
AS_HELP_STRING([--enable-debug[=yes/relaxed/profile/debugprofile/optimised/no]],[Compile debug version [[yes]]]),
[ enable_debug=${enableval} ], [ enable_debug=yes ])
[ enable_debug=${enableval} ], [ enable_debug=no ])
AC_MSG_CHECKING([whether to compile in debug mode])
AC_MSG_RESULT([${enable_debug}])

Expand Down
4 changes: 2 additions & 2 deletions lib/netplay/netplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ unsigned NET_PlayerConnectionStatus[CONNECTIONSTATUS_NORMAL][MAX_PLAYERS];
**/
static char const *versionString = version_getVersionString();
static int NETCODE_VERSION_MAJOR = 6;
static int NETCODE_VERSION_MINOR = 5;
static int NETCODE_VERSION_MINOR = 20120314;

bool NETisCorrectVersion(uint32_t game_version_major, uint32_t game_version_minor)
{
Expand Down Expand Up @@ -1378,7 +1378,7 @@ static bool NETprocessSystemMessage(NETQUEUE playerQueue, uint8_t type)
debug(LOG_ERROR, "Incomplete NET_SEND_TO_PLAYER.");
break;
}
if (sender > MAX_PLAYERS || receiver > MAX_PLAYERS)
if (sender > MAX_PLAYERS || (receiver > MAX_PLAYERS && receiver != NET_ALL_PLAYERS))
{
debug(LOG_ERROR, "Bad NET_SEND_TO_PLAYER.");
break;
Expand Down
47 changes: 17 additions & 30 deletions macosx/Warzone.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
438B0C1E13773258008184FC /* Png - Fetch source */,
438B0C32137733B4008184FC /* PhysFS - Fetch source */,
438B0C2B1377336E008184FC /* Vorbis - Fetch source */,
43964E45150EDCE2007BCC60 /* Vorbis - Patch */,
438B0C3A137733F8008184FC /* Theora - Fetch source */,
438B0C101377317F008184FC /* Gettext - Fetch source */,
);
Expand Down Expand Up @@ -670,7 +671,7 @@
"${DERIVED_FILES_DIR}/${INPUT_FILE_BASE}.h",
"${DERIVED_FILES_DIR}/${INPUT_FILE_BASE}.tab.cpp",
);
script = "bison --output-file=\"${DERIVED_FILES_DIR}/${INPUT_FILE_BASE}.tab.cpp\" \"${INPUT_FILE_PATH}\" || exit 1\ncp \"${DERIVED_FILES_DIR}/${INPUT_FILE_BASE}.tab.hpp\" \"${DERIVED_FILES_DIR}/${INPUT_FILE_BASE}.h\"\nexit ${?}";
script = ". configs/rulescripts/y.sh";
};
0246AA730BD3E47F004D1C70 /* PBXBuildRule */ = {
isa = PBXBuildRule;
Expand All @@ -681,18 +682,7 @@
"${DERIVED_FILES_DIR}/${INPUT_FILE_BASE}.cpp",
"${DERIVED_FILES_DIR}/${INPUT_FILE_BASE}.h",
);
script = "flex --outfile=\"${DERIVED_FILES_DIR}/${INPUT_FILE_BASE}.cpp\" --header-file=\"${DERIVED_FILES_DIR}/${INPUT_FILE_BASE}.h\" \"${INPUT_FILE_PATH}\" || exit 1\nexit ${?}";
};
433360D411A07A7E00380F5E /* PBXBuildRule */ = {
isa = PBXBuildRule;
compilerSpec = com.apple.compilers.proxy.script;
filePatterns = "*.h";
fileType = pattern.proxy;
isEditable = 1;
outputFiles = (
"${DERIVED_FILES_DIR}/${INPUT_FILE_BASE}.moc.cpp",
);
script = "export PATH=/sw/lib/qt4-mac/bin:/sw/lib/qt4-x11/bin:/opt/local/bin:${PATH}\nmoc -o \"${DERIVED_FILES_DIR}/${INPUT_FILE_BASE}.moc.cpp\" \"${INPUT_FILE_PATH}\"\nexit ${?}\n# Files w/ \"Q_OBJECT\"";
script = ". configs/rulescripts/l.sh";
};
/* End PBXBuildRule section */

Expand Down Expand Up @@ -3670,7 +3660,6 @@
02581CC40BD5AD5300957CBC /* Copy game data */,
);
buildRules = (
433360D411A07A7E00380F5E /* PBXBuildRule */,
0246AA4D0BD3E067004D1C70 /* PBXBuildRule */,
0246AA730BD3E47F004D1C70 /* PBXBuildRule */,
);
Expand Down Expand Up @@ -3754,7 +3743,6 @@
isa = PBXNativeTarget;
buildConfigurationList = 02DDA7F00BD3C03F0049AB60 /* Build configuration list for PBXNativeTarget "Vorbis" */;
buildPhases = (
43D4669013FBF5AC00E5C499 /* Patch */,
02DDA7E90BD3C03F0049AB60 /* Headers */,
02DDA7EA0BD3C03F0049AB60 /* Resources */,
02DDA7EB0BD3C03F0049AB60 /* Sources */,
Expand Down Expand Up @@ -4373,6 +4361,20 @@
shellPath = /bin/sh;
shellScript = ". configs/fetchscripts/Theora-FetchSource.sh";
};
43964E45150EDCE2007BCC60 /* Vorbis - Patch */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Vorbis - Patch";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "cd ${SRCROOT}/external/libvorbis\n\nif [ -f \"vorbis.diff\" ]; then\n\texit 0\nfi\n\nif ! curl -LfOC - --connect-timeout \"30\" \"http://wz2100.net/~dak180/BuildTools/Mac/vorbis.diff\"; then\n\techo \"error: Unable to fetch vorbis.diff\" >&2\n\texit 1\nfi\n\nif ! cat \"vorbis.diff\" | patch --posix -sNfp0; then\n\techo \"error: Unable to apply vorbis.diff\" >&2\n\texit 1\nfi\n\nexit 0\n";
};
43B8FF2D127CD57D006F5A13 /* Fonts */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
Expand Down Expand Up @@ -4443,21 +4445,6 @@
shellPath = /bin/sh;
shellScript = "# Config\nexport PATH=$PATH:/sw/bin:/opt/local/bin\nsauto=\"src/autorevision.h\"\ntauto=\"${OBJROOT}/autorev/autorevision.h\"\nfunction hfilter {\n\trm -f \"${OBJROOT}/autorevision.h\"\n\tsed -e 's:refs/heads/:branch/:' -e 's:refs/remotes/:remote/:' -e 's:branch/master:Master:' -e 's:\tv:\t:' -e 's:v/::' \"${sauto}\" | sed -e 's:_beta: Beta :' -e 's:_rc: RC :' > \"${OBJROOT}/autorevision.h\"\n}\nfunction bauto {\n\tif ! ./build_tools/autorevision.sh \"${tauto}\"; then\n\t\techo \"error: Could not run Autorevision\"\n\t\texit 1\n\tfi\n}\n\ncd ..\n\nif [[ ! -d \".git\" ]] && [[ ! -d \".hg\" ]] && [[ -f \"${sauto}\" ]]; then\n\t# Do not run if we will not get useful information\n\techo \"Not a repo.\"\n\thfilter\n\texit 0\nelif [ -d \"${OBJROOT}/autorev/\" ]; then\n\t# Only update src/autorevision.h if something has changed\n\tbauto\n\tmdck1=`md5 -q \"${sauto}\"`\n\tmdck2=`md5 -q \"${tauto}\"`\n\tif [ \"${mdck1}\" = \"${mdck2}\" ]; then\n\t\texit 0\n\tfi\nelse\n\tmkdir \"${OBJROOT}/autorev/\"\n\tbauto\nfi\n\ncp -a \"${tauto}\" \"${sauto}\"\nhfilter\nexit 0\n";
};
43D4669013FBF5AC00E5C499 /* Patch */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = Patch;
outputPaths = (
external/libvorbis/vorbis.diff,
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "cd ${SRCROOT}/external/libvorbis\n\nif [ -f \"vorbis.diff\" ]; then\n\texit 0\nfi\n\nif ! curl -LfOC - --connect-timeout \"30\" \"http://wz2100.net/~dak180/BuildTools/Mac/vorbis.diff\"; then\n\techo \"error: Unable to fetch vorbis.diff\" >&2\n\texit 1\nfi\n\nif ! cat \"vorbis.diff\" | patch --posix -sNfp0; then\n\techo \"error: Unable to apply vorbis.diff\" >&2\n\texit 1\nfi\n\nexit 0\n";
};
43F77C7610F0125E00E04615 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
Expand Down
5 changes: 5 additions & 0 deletions macosx/configs/rulescripts/h.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh

export PATH=/sw/lib/qt4-mac/bin:/sw/lib/qt4-x11/bin:/opt/local/bin:${PATH}
moc -o "${DERIVED_FILES_DIR}/${INPUT_FILE_BASE}.moc.cpp" "${INPUT_FILE_PATH}" || exit 1
# Files w/ "Q_OBJECT"
4 changes: 4 additions & 0 deletions macosx/configs/rulescripts/l.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh

flex --outfile="${DERIVED_FILES_DIR}/${INPUT_FILE_BASE}.cpp" --header-file="${DERIVED_FILES_DIR}/${INPUT_FILE_BASE}.h" "${INPUT_FILE_PATH}" || exit 1
exit ${?}
5 changes: 5 additions & 0 deletions macosx/configs/rulescripts/y.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh

bison --output-file="${DERIVED_FILES_DIR}/${INPUT_FILE_BASE}.tab.cpp" "${INPUT_FILE_PATH}" || exit 1
cp "${DERIVED_FILES_DIR}/${INPUT_FILE_BASE}.tab.hpp" "${DERIVED_FILES_DIR}/${INPUT_FILE_BASE}.h"
exit ${?}
10 changes: 5 additions & 5 deletions src/astar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,10 @@ static PathCoord fpathAStarExplore(PathfindContext &context, PathCoord tileF)
// loop through possible moves in 8 directions to find a valid move
for (unsigned dir = 0; dir < ARRAY_SIZE(aDirOffset); ++dir)
{
// Try a new location
int x = node.p.x + aDirOffset[dir].x;
int y = node.p.y + aDirOffset[dir].y;

/*
5 6 7
\|/
Expand All @@ -372,7 +376,7 @@ static PathCoord fpathAStarExplore(PathfindContext &context, PathCoord tileF)
3 2 1
odd:orthogonal-adjacent tiles even:non-orthogonal-adjacent tiles
*/
if (dir % 2 != 0)
if (dir % 2 != 0 && !context.dstIgnore.isNonblocking(node.p.x, node.p.y) && !context.dstIgnore.isNonblocking(x, y))
{
int x, y;

Expand All @@ -391,10 +395,6 @@ static PathCoord fpathAStarExplore(PathfindContext &context, PathCoord tileF)
}
}

// Try a new location
int x = node.p.x + aDirOffset[dir].x;
int y = node.p.y + aDirOffset[dir].y;

// See if the node is a blocking tile
if (context.isBlocked(x, y))
{
Expand Down
39 changes: 20 additions & 19 deletions src/display.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,11 @@ static bool bLasSatStruct;
static MOUSE_TARGET itemUnderMouse(BASE_OBJECT **ppObjUnderCursor);
static bool bShakingPermitted = true;

bool isMouseOverRadar()
{
return mouseOverRadar;
}

void setMouseScroll(bool scroll)
{
mouseScroll = scroll;
Expand Down Expand Up @@ -298,7 +303,7 @@ bool dispInitialise(void)
}


void ProcessRadarInput(void)
void ProcessRadarInput()
{
int PosX, PosY;
int x = mouseX();
Expand Down Expand Up @@ -380,6 +385,18 @@ void ProcessRadarInput(void)
requestRadarTrack(PosX*TILE_UNITS,PosY*TILE_UNITS);
}
}
// ctrl-alt-scroll changes game speed
if (!keyDown(KEY_LCTRL) || !keyDown(KEY_LALT))
{
if (mousePressed(MOUSE_WUP))
{
kf_RadarZoomIn();
}
else if (mousePressed(MOUSE_WDN))
{
kf_RadarZoomOut();
}
}
}
}
}
Expand All @@ -397,19 +414,13 @@ void resetInput(void)
/* Process the user input. This just processes the key input and jumping around the radar*/
void processInput(void)
{
bool mOverRadar = false;
bool mOverConstruction = false;

if (InGameOpUp || isInGamePopupUp)
{
dragBox3D.status = DRAG_RELEASED; // disengage the dragging since it stops menu input
}

if (radarOnScreen && radarPermitted && CoordInRadar(mouseX(), mouseY()))
{
mOverRadar = true;
}

if(CoordInBuild(mouseX(), mouseY()))
{
mOverConstruction = true;
Expand All @@ -425,18 +436,13 @@ void processInput(void)
ignoreRMBC = false;

/* Process all of our key mappings */
if (mousePressed(MOUSE_WUP))
if (mousePressed(MOUSE_WUP) && !isMouseOverRadar())
{
/* Ctrl+Alt+WheelUp makes game speed up */
if (keyDown(KEY_LCTRL) && keyDown(KEY_LALT))
{
kf_SpeedUp();
}
/* Decide if radar or world zoom in */
else if (mOverRadar)
{
kf_RadarZoomIn();
}
else if (mOverConstruction)
{
kf_BuildPrevPage();
Expand All @@ -447,18 +453,13 @@ void processInput(void)
}
}

if (mousePressed(MOUSE_WDN))
if (mousePressed(MOUSE_WDN) && !isMouseOverRadar())
{
/* Ctrl+Alt+WheelDown makes game slow down */
if (keyDown(KEY_LCTRL) && keyDown(KEY_LALT))
{
kf_SlowDown();
}
/* Decide if radar or world zoom out */
else if (mOverRadar)
{
kf_RadarZoomOut();
}
else if (mOverConstruction)
{
kf_BuildNextPage();
Expand Down
4 changes: 3 additions & 1 deletion src/display.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ extern bool dispInitialise(void);
extern void shakeStart(void);
extern void shakeStop(void);

extern void ProcessRadarInput(void);
void ProcessRadarInput();

extern void processInput(void);
/*don't want to do any of these whilst in the Intelligence Screen*/
Expand All @@ -52,6 +52,8 @@ extern void clearSelection(void);
// deal with selecting a droid
extern void dealWithDroidSelect(DROID *psDroid, bool bDragBox);

bool isMouseOverRadar();

extern void setInvertMouseStatus( bool val );
extern bool getInvertMouseStatus( void );

Expand Down
9 changes: 2 additions & 7 deletions src/display3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2240,12 +2240,7 @@ void renderStructure(STRUCTURE *psStructure)

dv.x = structX - player.p.x;
dv.z = -(structY - player.p.z);
if (defensive || structureIsBlueprint(psStructure))
{
dv.y = psStructure->pos.z;
} else {
dv.y = map_TileHeight(map_coord(structX), map_coord(structY));
}
dv.y = psStructure->pos.z;
/* Push the indentity matrix */
pie_MatBegin();

Expand Down Expand Up @@ -2654,7 +2649,7 @@ static bool renderWallSection(STRUCTURE *psStructure)
/* Establish where it is in the world */
dv.x = structX - player.p.x;
dv.z = -(structY - player.p.z);
dv.y = map_Height(structX, structY);
dv.y = psStructure->pos.z;

if (psStructure->pStructureType->type == REF_GATE && psStructure->state == SAS_OPEN)
{
Expand Down
2 changes: 1 addition & 1 deletion src/loop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ static GAMECODE renderLoop()
processInput();

//no key clicks or in Intelligence Screen
if (intRetVal == INT_NONE && !InGameOpUp && !isInGamePopupUp)
if (!isMouseOverRadar() && intRetVal == INT_NONE && !InGameOpUp && !isInGamePopupUp)
{
processMouseClickInput();
}
Expand Down
25 changes: 9 additions & 16 deletions src/mission.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2812,29 +2812,22 @@ void initNoGoAreas(void)
//sets the coords for a no go area
void setNoGoArea(UBYTE x1, UBYTE y1, UBYTE x2, UBYTE y2, UBYTE area)
{
//quick check that x2 > x1 and y2 > y1
// make sure that x2 > x1 and y2 > y1
if (x2 < x1)
{
sLandingZone[area].x1 = x2;
sLandingZone[area].x2 = x1;
}
else
{
sLandingZone[area].x1 = x1;
sLandingZone[area].x2 = x2;
std::swap(x1, x2);
}
if (y2 < y1)
{
sLandingZone[area].y1 = y2;
sLandingZone[area].y2 = y1;
}
else
{
sLandingZone[area].y1 = y1;
sLandingZone[area].y2 = y2;
std::swap(y1, y2);
}

if (area == 0)
sLandingZone[area].x1 = x1;
sLandingZone[area].x2 = x2;
sLandingZone[area].y1 = y1;
sLandingZone[area].y2 = y2;

if (area == 0 && x1 && y1)
{
addLandingLights(getLandingX(area) + 64, getLandingY(area) + 64);
}
Expand Down
1 change: 1 addition & 0 deletions src/move.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2484,6 +2484,7 @@ void moveUpdateDroid(DROID *psDroid)
// check the location for vtols
Vector2i tar = removeZ(psDroid->pos);
if (psDroid->order.type != DORDER_PATROL && psDroid->order.type != DORDER_CIRCLE // Not doing an order which means we never land (which means we might want to land).
&& psDroid->action != DACTION_MOVETOREARM && psDroid->action != DACTION_MOVETOREARMPOINT
&& actionVTOLLandingPos(psDroid, &tar) // Can find a sensible place to land.
&& map_coord(tar) != map_coord(psDroid->sMove.destination)) // We're not at the right place to land.
{
Expand Down
Loading