This is the mail archive of the xconq7@sources.redhat.com mailing list for the Xconq project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Bug: Tank sitting in water


>On Mon, 06 Jan 2003 18:22:05 +0000
>"Richard Hunt" <0102806H@student.gla.ac.uk> wrote:
>
>> I've just come across what I think is a bug in the standard game (which
>>is very easy to recreate). If you have two troop transports in a hex, and
>>you are selected on an armor or infantry in one of the transports, then
>>click in that hex, but the part that the transports are not in, then you
>>can move the unit into the sea. It doesn't drown or anything, it can
>>attack but it can't move.
>>
>> By the way I'm just starting to read through the code, but I haven't got
>>that far through it.
>> Richard Hunt
>>
>
>It works ?
>
>--- ui.c.orig   Tue Jan  7 09:19:14 2003
>+++ ui.c        Tue Jan  7 09:18:18 2003
>@@ -2819,6 +2819,9 @@
>        } else if (unit->transport != NULL) {
>            /* Unit is an occupant wanting to leave, but yet remain in
>               the same cell as the transport. */
>+           if (terrain_always_impassable((unit->type),
>terrain_at(unit->x, unit->y))) {
>+               return FALSE;
>+           }
>            rslt = check_move_action(unit, unit, x, y, z);
>            if (valid(rslt)) {
>                net_prep_move_action(unit, unit, x, y, z);
>
>--
>MA, Dunzi

It does! However, I was still able to make a unit jump overboard by using
the Disembark command. By putting your fix  at the end of check_move_action
instead (where it really belongs), it catches this as well as AI controlled
actions of the same type:

+   if (terrain_always_impassable((unit2->type), terrain_at(x, y))) {
+	  return A_ANY_CANNOT_DO;
+   }
    /* We have to have a minimum level of supply to be able to move. */
    for_all_material_types(m) {
	if (unit2->supply[m] < um_to_move(u2, m))
	  return A_ANY_NO_MATERIAL;
    }
    return A_ANY_OK;
}

Hans



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]