Skip to content

Commit f45d614

Browse files
1269339743KJeff01
authored andcommitted
Fix naval damage, production and camera
1 parent 62c2d88 commit f45d614

File tree

5 files changed

+14
-7
lines changed

5 files changed

+14
-7
lines changed

data/mp/stats/propulsion.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@
6666
"Naval": {
6767
"buildPoints": 150,
6868
"buildPower": 150,
69+
"designable": 1,
6970
"hitpointPctOfBody": 300,
7071
"id": "Naval",
7172
"model": "prhnaval1.pie",

data/mp/stats/weaponmodifier.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"Hover": 120,
55
"Legged": 65,
66
"Lift": 40,
7+
"Propellor": 105,
78
"Tracked": 105,
89
"Wheeled": 125
910
},
@@ -12,6 +13,7 @@
1213
"Hover": 110,
1314
"Legged": 150,
1415
"Lift": 60,
16+
"Propellor": 50,
1517
"Tracked": 40,
1618
"Wheeled": 100
1719
},
@@ -20,6 +22,7 @@
2022
"Hover": 90,
2123
"Legged": 30,
2224
"Lift": 80,
25+
"Propellor": 120,
2326
"Tracked": 120,
2427
"Wheeled": 130
2528
},
@@ -28,6 +31,7 @@
2831
"Hover": 110,
2932
"Legged": 130,
3033
"Lift": 25,
34+
"Propellor": 65,
3135
"Tracked": 30,
3236
"Wheeled": 90
3337
},
@@ -36,6 +40,7 @@
3640
"Hover": 20,
3741
"Legged": 30,
3842
"Lift": 30,
43+
"Propellor": 50,
3944
"Tracked": 50,
4045
"Wheeled": 30
4146
},
@@ -44,6 +49,7 @@
4449
"Hover": 130,
4550
"Legged": 130,
4651
"Lift": 25,
52+
"Propellor": 90,
4753
"Tracked": 90,
4854
"Wheeled": 110
4955
}

src/display3d.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1240,7 +1240,7 @@ static int calcAverageTerrainHeight(int tileX, int tileZ)
12401240
/* Get a pointer to the tile at this location */
12411241
MAPTILE *psTile = mapTile(tileX + j, tileZ + i);
12421242

1243-
result += psTile->height;
1243+
result += std::max(psTile->height, psTile->waterLevel);
12441244
numTilesAveraged++;
12451245
}
12461246
}

src/structure.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2429,12 +2429,12 @@ void clearCommandDroidFactory(DROID *psDroid)
24292429
}
24302430

24312431
/* Check that a tile is vacant for a droid to be placed */
2432-
static bool structClearTile(UWORD x, UWORD y)
2432+
static bool structClearTile(UWORD x, UWORD y, PROPULSION_TYPE propulsion)
24332433
{
24342434
UDWORD player;
24352435

24362436
/* Check for a structure */
2437-
if (fpathBlockingTile(x, y, PROPULSION_TYPE_WHEELED))
2437+
if (fpathBlockingTile(x, y, propulsion))
24382438
{
24392439
debug(LOG_NEVER, "failed - blocked");
24402440
return false;
@@ -2465,7 +2465,7 @@ static bool comparePlacementPoints(Vector2i a, Vector2i b)
24652465
}
24662466

24672467
/* Find a location near to a structure to start the droid of */
2468-
bool placeDroid(STRUCTURE *psStructure, UDWORD *droidX, UDWORD *droidY)
2468+
bool placeDroid(STRUCTURE *psStructure, const DROID_TEMPLATE * psTempl, UDWORD *droidX, UDWORD *droidY)
24692469
{
24702470
CHECK_STRUCTURE(psStructure);
24712471

@@ -2512,7 +2512,7 @@ bool placeDroid(STRUCTURE *psStructure, UDWORD *droidX, UDWORD *droidY)
25122512
{
25132513
for (int x = xmin; x <= xmax; ++x)
25142514
{
2515-
if (structClearTile(x, y))
2515+
if (structClearTile(x, y, psTempl->getPropulsionStats()->propulsionType))
25162516
{
25172517
tiles.push_back(Vector2i(12 * x - sx, 12 * y - sy));
25182518
}
@@ -2604,7 +2604,7 @@ static bool structPlaceDroid(STRUCTURE *psStructure, DROID_TEMPLATE *psTempl, DR
26042604

26052605
CHECK_STRUCTURE(psStructure);
26062606

2607-
placed = placeDroid(psStructure, &x, &y);
2607+
placed = placeDroid(psStructure, psTempl, &x, &y);
26082608

26092609
if (placed)
26102610
{

src/structure.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ void resetFactoryNumFlag();
155155
STRUCTURE_STATS *structGetDemolishStat();
156156

157157
/*find a location near to the factory to start the droid of*/
158-
bool placeDroid(STRUCTURE *psStructure, UDWORD *droidX, UDWORD *droidY);
158+
bool placeDroid(STRUCTURE *psStructure, const DROID_TEMPLATE * psTempl, UDWORD *droidX, UDWORD *droidY);
159159

160160
//Set the factory secondary orders to a droid
161161
void setFactorySecondaryState(DROID *psDroid, STRUCTURE *psStructure);

0 commit comments

Comments
 (0)