Update of /cvsroot/xconq/xconq/kernel
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv31089/kernel
Modified Files:
Tag: BRANCH_MCAMPO_PATH
actions.c
Log Message:
Fix some issues with application of coatings by units.
Index: actions.c
===================================================================
RCS file: /cvsroot/xconq/xconq/kernel/actions.c,v
retrieving revision 1.23
retrieving revision 1.23.2.1
diff -C2 -d -r1.23 -r1.23.2.1
*** actions.c 2 Jul 2005 20:14:22 -0000 1.23
--- actions.c 8 Apr 2007 18:47:01 -0000 1.23.2.1
***************
*** 3990,3994 ****
oldval = aux_terrain_at(x, y, t);
/* Interpret "dir" as depth of coating to add. */
! newval = min(oldval + dir, tt_coat_max(terrain_at(x, y), t));
set_aux_terrain_at(x, y, t, newval);
break;
--- 3990,3995 ----
oldval = aux_terrain_at(x, y, t);
/* Interpret "dir" as depth of coating to add. */
! /* Fix indices of tt_coat_max. Massimo, 16 March 2007 */
! newval = min(oldval + dir, tt_coat_max(t, terrain_at(x, y)));
set_aux_terrain_at(x, y, t, newval);
break;
***************
*** 4102,4106 ****
newval = max(oldval - dir, 0);
/* If newval drops below the min coating depth, coating will vanish. */
! if (newval < tt_coat_min(terrain_at(x, y), t))
newval = 0;
set_aux_terrain_at(x, y, t, newval);
--- 4103,4108 ----
newval = max(oldval - dir, 0);
/* If newval drops below the min coating depth, coating will vanish. */
! /* Fix indices of tt_coat_min. Massimo, 16 March 2007 */
! if (newval < tt_coat_min(t, terrain_at(x, y)))
newval = 0;
set_aux_terrain_at(x, y, t, newval);
***************
*** 4121,4131 ****
distribute_material(unit2, m, excess);
}
}
- /* Then try to fill up unit2 again with the remaining excess. */
- space = um_storage_x(unit2->type, m) - unit2->supply[m];
- /* The check for available space is redundant now, but will be needed
- in the future when distribute_material has been improved. */
- unit2->supply[m] += min(excess, space);
-
/* Let everybody see what has happened. */
for_all_sides(side) {
--- 4123,4134 ----
distribute_material(unit2, m, excess);
}
+ /* Extend for_all_material_types to include the following stuff.
+ Massimo, 16 March 2007 */
+ /* Then try to fill up unit2 again with the remaining excess. */
+ space = um_storage_x(unit2->type, m) - unit2->supply[m];
+ /* The check for available space is redundant now, but will be needed
+ in the future when distribute_material has been improved. */
+ unit2->supply[m] += min(excess, space);
}
/* Let everybody see what has happened. */
for_all_sides(side) {
|