Skip to content
Browse files

Merge branch 'bugfixes' into 3.1

* bugfixes:
  Update ChangeLog.
  Only show landing lights when they're actually somewhere on the map.
  cleanup: Simplify setNoGoArea a bit.
  Make escape work again when the mouse is over the menu.
  Pathfind to oil wells which are only accessible from a diagonal tile.
  Rearm on rearming pads instead of beside rearming pads.
  Make VTOL rearming pads stay above ground.
  Move radar handling from processInput() to processRadarInput().
  Fix broken multiplayer.
  Externalize the custom build rule scripts.
  • Loading branch information...
2 parents ab101da + 424d852 commit 5f06516397f5234ec53fce71dea11919b8e6e0a1 @cybersphinx cybersphinx committed
View
11 ChangeLog
@@ -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)
View
2 lib/netplay/netplay.cpp
@@ -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;
View
47 macosx/Warzone.xcodeproj/project.pbxproj
@@ -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 */,
);
@@ -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;
@@ -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 */
@@ -3670,7 +3660,6 @@
02581CC40BD5AD5300957CBC /* Copy game data */,
);
buildRules = (
- 433360D411A07A7E00380F5E /* PBXBuildRule */,
0246AA4D0BD3E067004D1C70 /* PBXBuildRule */,
0246AA730BD3E47F004D1C70 /* PBXBuildRule */,
);
@@ -3754,7 +3743,6 @@
isa = PBXNativeTarget;
buildConfigurationList = 02DDA7F00BD3C03F0049AB60 /* Build configuration list for PBXNativeTarget "Vorbis" */;
buildPhases = (
- 43D4669013FBF5AC00E5C499 /* Patch */,
02DDA7E90BD3C03F0049AB60 /* Headers */,
02DDA7EA0BD3C03F0049AB60 /* Resources */,
02DDA7EB0BD3C03F0049AB60 /* Sources */,
@@ -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;
@@ -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;
View
5 macosx/configs/rulescripts/h.sh
@@ -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"
View
4 macosx/configs/rulescripts/l.sh
@@ -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 ${?}
View
5 macosx/configs/rulescripts/y.sh
@@ -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 ${?}
View
10 src/astar.cpp
@@ -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
\|/
@@ -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;
@@ -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))
{
View
39 src/display.cpp
@@ -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;
@@ -298,7 +303,7 @@ bool dispInitialise(void)
}
-void ProcessRadarInput(void)
+void ProcessRadarInput()
{
int PosX, PosY;
int x = mouseX();
@@ -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();
+ }
+ }
}
}
}
@@ -397,7 +414,6 @@ 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)
@@ -405,11 +421,6 @@ void processInput(void)
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;
@@ -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();
@@ -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();
View
4 src/display.h
@@ -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*/
@@ -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 );
View
9 src/display3d.cpp
@@ -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();
@@ -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)
{
View
2 src/loop.cpp
@@ -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();
}
View
25 src/mission.cpp
@@ -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);
}
View
1 src/move.cpp
@@ -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.
{
View
24 src/structure.cpp
@@ -1273,16 +1273,36 @@ static void buildFlatten(STRUCTURE *pStructure, int h)
}
}
+static bool isPulledToTerrain(STRUCTURE const *psBuilding)
+{
+ STRUCTURE_TYPE type = psBuilding->pStructureType->type;
+ return type == REF_DEFENSE || type == REF_GATE || type == REF_WALL || type == REF_WALLCORNER || type == REF_REARM_PAD;
+}
+
void alignStructure(STRUCTURE *psBuilding)
{
/* DEFENSIVE structures are pulled to the terrain */
- if (psBuilding->pStructureType->type != REF_DEFENSE && psBuilding->pStructureType->type != REF_GATE && psBuilding->pStructureType->type != REF_WALL && psBuilding->pStructureType->type != REF_WALLCORNER)
+ if (!isPulledToTerrain(psBuilding))
{
int mapH = foundationHeight(psBuilding);
buildFlatten(psBuilding, mapH);
psBuilding->pos.z = mapH;
- psBuilding->foundationDepth = 0.0f;
+ psBuilding->foundationDepth = psBuilding->pos.z;
+
+ // Align surrounding structures.
+ StructureBounds b = getStructureBounds(psBuilding);
+ for (int breadth = -1; breadth <= b.size.y; ++breadth)
+ {
+ for (int width = -1; width <= b.size.x; ++width)
+ {
+ STRUCTURE *neighbourStructure = castStructure(mapTile(b.map.x + width, b.map.y + breadth)->psObject);
+ if (neighbourStructure != NULL && isPulledToTerrain(neighbourStructure))
+ {
+ alignStructure(neighbourStructure); // Recursive call, but will go to the else case, so will not re-recurse.
+ }
+ }
+ }
}
else
{

0 comments on commit 5f06516

Please sign in to comment.
Something went wrong with that request. Please try again.