|Anonymous | Login | Signup for a new account||2013-06-19 03:16 CEST|
|Main | My View | View Issues | Change Log | Roadmap | Repositories|
|View Issue Details|
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0000460||Spring engine||General||public||2007-03-05 17:45||2007-03-10 19:31|
|Target Version||Fixed in Version|
|Summary||0000460: Units with hover movetype cannot be loaded into a transport|
|Description||Units with hover movetype cannot be loaded into a transport, no matter their size and mass. Looks like an unwanted feature.|
Digging through the code reveals that this also applies for ships and aircraft.
|Additional Information||This is caused by the following code in TransportCAI.cpp:|
bool CTransportCAI::CanTransport(CUnit* unit)
if(unit->mass>=100000 || unit->beingBuilt)
// don't transport cloaked enemies
if (unit->isCloaked && !gs->AlliedTeams(unit->team, owner->team))
if(unit->unitDef->canhover || unit->unitDef->floater || unit->unitDef->canfly)
if(unit->xsize > owner->unitDef->transportSize*2)
if(unit->mass+transport->transportMassUsed > owner->unitDef->transportMass)
Attached file contains a patch that completely disables movetype check in that function, so that all units can be loaded if their size and mass allow for that.
|Tags||No tags attached.|
|Attached Files|| noMovetypeCheck.diff [^] (516 bytes) 2007-03-05 17:45 [Show Content]
transportation_diffs2.zip [^] (2,733 bytes) 2007-03-08 18:38
transportation_patch.zip [^] (1,957 bytes) 2007-03-09 11:12
|I compiled Spring with that change to test it and was able to load/unload hovers and small aircraft with air and sea transports. Haven't tried to load ships as they seem to have enough mass (or too big a size) to not be loadable anyway.|
|Apparently air transport for ships used to work in Spring, so this code must have been inserted a while back. Does the transport code check to see if it is dropping off on water which we'd need to check for with transporting sea units/hovers? Also, we may want to make this a mod definable option with the default set to no transport of these units so we don't break any of the current mods.|
edited on: 2007-03-08 18:43
I made a new patch (transportation_diffs2.zip contains it). This one is much more flexible - it allows per-mod control of what unit types are transportable.
A new section should be added to modrules.tdf:
Each value controls the transportability of the corresponding unit type. Defaults are 1 for ground and 0 for everything else. I wanted to add buildings also, but that proved a bit too much for me :)
Also I changed unload function so that units can be unloaded into water (needed for ships). It checks for ground height and unit's minWaterDepth, so land units won't be unloaded into water and ships won't be dropped on land.
Problems found while testing this: if you load an aircraft into an air transport, it will start to accend and will do so indefinitely without a way to stop it or unload the cargo. Loading/unloading aircraft with non-air transport works ok, though.
Edit: the first zip (transportation_diffs.zip) contains incomplete path (unloading into water only works for air transports). Look into the second zip (transportation_diffs2.zip) for a complete one (works for all transports). I cannot find a way to delete the first file.
|I deleted the first zip for you. In the future, unified diffs are the preferred method. I don't know if you are using TortoiseSVN, but you would create the patch by right clicking on base spring source directory.|
edited on: 2007-03-09 11:17
I have modified the patch to be a bit simpler. Now unload position check function just checks for minWaterDepth and maxWaterDepth without special conditions for ships, hovers etc. (min/maxWaterDepth is sufficient, and this also allows to unload TA-style amphibious tanks to the water). Also, it is all in one unified diff now.
Revision 0003467: Committed. Thank you.
I did add the slope check you wanted to do. You do unit->unitDef->movedata->maxSlope < slope.
Thank you for the unified diff.
|2007-03-05 17:45||yuritch||New Issue|
|2007-03-05 17:45||yuritch||File Added: noMovetypeCheck.diff|
|2007-03-05 17:51||yuritch||Note Added: 0000758|
|2007-03-06 15:03||el_matarife||Note Added: 0000766|
|2007-03-08 18:23||yuritch||File Added: transportation_diffs.zip|
|2007-03-08 18:37||yuritch||Note Added: 0000773|
|2007-03-08 18:38||yuritch||File Added: transportation_diffs2.zip|
|2007-03-08 18:42||yuritch||Note Edited: 0000773|
|2007-03-08 18:43||yuritch||Note Edited: 0000773|
|2007-03-09 05:59||ILMTitan||Status||new => assigned|
|2007-03-09 05:59||ILMTitan||Assigned To||=> ILMTitan|
|2007-03-09 06:01||ILMTitan||File Deleted: transportation_diffs.zip|
|2007-03-09 06:04||ILMTitan||Note Added: 0000775|
|2007-03-09 11:12||yuritch||File Added: transportation_patch.zip|
|2007-03-09 11:14||yuritch||Note Added: 0000776|
|2007-03-09 11:17||yuritch||Note Edited: 0000776|
|2007-03-10 19:31||ILMTitan||Status||assigned => resolved|
|2007-03-10 19:31||ILMTitan||Resolution||open => fixed|
|2007-03-10 19:31||ILMTitan||Note Added: 0000777|
|Copyright © 2000 - 2013 MantisBT Team|