f1df44dd2c
(bp): Rename member val to bp_item, member avail to bp_avail. Users
...
changed. Switch from int to short, to match struct sctstr members
sct_item and sct_avail.
Symbolic indexes for struct bp member bp_item[]:
(BP_NONE, BP_CIVIL, BP_MILIT, BP_SHELL, BP_GUN, BP_LCM, BP_HCM)
(BP_MAX): New.
(bug_key): Use them. Values are now array indexes, not indexes + 1.
(bp_get_item, bp_put_item, bp_set_from_sect): Update for changed
bud_key[].
2007-01-13 17:33:59 +00:00
c9c06d4fbe
(alloc_bp, bp_alloc): Rename.
...
(fill_update_array, bp_set_from_sect): Rename.
(gt_bg_nmbr, pt_bg_nmbr, bp_get_item, bp_get_avail, bp_put_item,
bp_put_avail): Separate accessor functions for item and avail.
2007-01-13 17:11:17 +00:00
ec203e88ad
(get_wp, bp_ref): Replace function returning pointer into a struct bp
...
by function returning to struct bp. Leave member access to callers.
Callers changed.
2007-01-13 12:01:12 +00:00
7db3523f62
Update known contributors comment.
2007-01-13 10:16:43 +00:00
5507e8a1dc
Replace the revolting build pointer data structure by a proper data
...
type. Make it abstract because that's possible. Change data layout
so that the slots belonging to a sector are together in memory, it's
nicer to the cache.
(bp): The new type. Users changed.
(get_wp): Update accordingly.
(alloc_bp): New.
(update_main, calc_all): Use it. Before, calc_all() allocated 1/7
more than necessary.
2007-01-13 09:07:59 +00:00
ac9cdf5bb9
(get_materials): Redesign.
...
(shiprepair, planerepair, landrepair): Use it. Behavioral change:
ship repairs outside harbors and plane repairs by a carrier can use
fewer materials. Before, such repairs consumed each required
commodity as far as available. Now, they consume the same fraction of
the real cost of each commodity, i.e. commodity use is limited by the
most scarce commodity. Neither old nor new behavior make much sense,
but the new code is simpler.
2007-01-10 07:15:45 +00:00
63bdc89835
Update copyright notice.
2007-01-09 19:09:31 +00:00
Ron Koenderink
6225e47f9f
(marc, navi): Switch the parsing logic to facilitate the merging marc()
...
and navi() in the future. No functional changes.
2007-01-06 12:35:44 +00:00
Ron Koenderink
a5f8742b3f
(landrepair): Allow land unit repairs in allied sectors
2007-01-04 13:22:06 +00:00
Ron Koenderink
ec28000e34
(decl): Prevent the deity from changing relations for a player to
...
self. Closes #1384998 . Allow the deity to set the relations of a
player towards the deity.
2007-01-03 12:54:41 +00:00
Ron Koenderink
67027e22d1
(arm): Prevent a nuke from being on two planes at the same time.
...
Closes #1602998 .
2007-01-02 23:57:40 +00:00
Ron Koenderink
14ad5f1276
(do_land_mob): Combine to two duplicate blocks of code.
2007-01-02 12:52:02 +00:00
Ron Koenderink
90b987058b
(march, navi): Switch to struct empobj * for leader and rename to leader.
...
No functional changes.
2007-01-02 12:50:56 +00:00
aafb4fdf8a
(setstr): Fix type error in variadic argument.
2006-12-31 17:21:11 +00:00
Ron Koenderink
4d7254498a
(planerepair): Fix so only the player's own planes and allied planes
...
are repaired. Closes #757081 .
2006-12-31 17:19:46 +00:00
6b70720318
New option AUTO_POWER; closes #1009993 :
...
(opt_AUTO_POWER, update_power): New.
(update_main): Implement AUTO_POWER.
(powe): Disable power new when AUTO_POWER is on.
(powe): New power update.
(gen_power): Compute power into buffer passed by caller, make write to
power file optional.
2006-12-31 16:56:34 +00:00
2c0416135e
(genpower, powcmp): Sort struct powstr powbuf[] instead of struct
...
powsort order[]. Marginally less efficient, but simpler.
(powsort): Unused, remove.
2006-12-31 13:38:46 +00:00
114a05e969
(update_main): Move logging of the update up to a more logical place.
2006-12-31 13:16:17 +00:00
Ron Koenderink
c6577ef2c5
(get_leader, pr_leader_change): New.
...
(set_leader, set_flagship): Replace with get_leader() and
pr_leader_change().
2006-12-31 12:31:18 +00:00
Ron Koenderink
69d6b01429
(planerepair) Remove the CANT_HAPPEN owner check
...
as allied planes and previously allied planes can
be on the ship.
2006-12-30 21:05:36 +00:00
Ron Koenderink
47e300b21e
(do_mob_land): Fix to use all excess mobility for fortification, not
...
just up to the land unit's current mobility.
2006-12-29 19:56:00 +00:00
Ron Koenderink
6ddbc9f950
(planerepair): Move the carrier sanity to before the carrier variable is
...
used.
2006-12-28 17:44:03 +00:00
Ron Koenderink
94af801449
(do_mob_land): Disable automatic land unit fortification with excess
...
mobility when MOB_ACCESS is on. It leads to excessively deep
recursion and thus miserable performance as the number of land units
grows.
2006-12-26 19:17:22 +00:00
Ron Koenderink
3e2cc8b746
(produce): Randomly flushed level production below 1.0 to zero. Fix.
...
(produce): Assign rounded level production to *ACTUAL instead of
randomly rounded one.
2006-12-26 19:15:41 +00:00
f4667a9457
Include pthread.h in the implementation instead of the header.
2006-12-26 16:52:11 +00:00
Ron Koenderink
ce63991c9f
(ef_open) [_WIN32]: Fix to get a read lock instead of a write lock for
...
EFF_RDONLY and to get a write lock instead of a total file lock for
file opened for writing.
2006-11-29 12:16:43 +00:00
a3b52a748c
Fix rev. 1.24, which failed to charge mobility for sweeping without
...
moving.
2006-11-21 22:26:30 +00:00
6a595c0bb7
(upd_ship): Don't produce stuff when broke, to match sector behavior.
2006-10-20 18:30:26 +00:00
Ron Koenderink
fd49704a74
(switch_leader): Generalize the code, no functional changes.
...
(navi): Change switch_flagship() to call switch_leader() instead.
(switch_flagship): Remove, not needed, replaced with switch_leader().
2006-10-10 20:23:19 +00:00
a4e79680e3
(take_casualties): Code for distributing casualties among units did
...
not make sense, and in its confusion destroyed land land units when it
shouldn't. Minimally invasive fix; code is still ugly and
incomprehensible.
2006-10-08 09:32:49 +00:00
7565435f0c
(guerrilla): Make security units not raid friendly che.
2006-10-08 09:21:26 +00:00
Ron Koenderink
cd8d742392
Combined struct llist and struct mlist into superset struct ulist.
...
(assa, set_leader, switch_leader, set_flagship, switch_flagship,
take_move_in_mob, get_land, ask_olist, att_get_defense,
get_dlist, get_ototal, get_dtotal, kill_land, att_infect_units,
put_land, att_reacting_units, count_bodies, att_fight,
send_reacting_units_home, take_def, ask_move_in, move_in_land,
lnd_print, lnd_delete, lnd_take_casualty, lnd_takemob,
lnd_sel, lnd_mar, lnd_put, lnd_sweep, contains_engineer,
lnd_check_mines, lnd_list, lnd_mess,
lnd_damage, lnd_easiest_target, lnd_mar_one_sector, shp_sel,
shp_nav, shp_put, shp_sweep, shp_check_one_mines, shp_check_mines,
shp_list, shp_mess, shp_count, shp_damage_one, shp_damage,
shp_contains, most_valuable_ship, shp_easiest_target,
shp_missile_interdiction, notify_coastguard,
shp_view, shp_nav_one_sector, shp_missdef, nav_ship,
fltp_to_list): Switch to struct ulist from either struct mlist
or struct llist.
2006-09-25 03:29:06 +00:00
7d90028f20
(out5): Rev. 1.36. didn't fully fix the format conditional.
...
Fold negative cases into positive ones.
2006-09-23 15:47:40 +00:00
dbfd0c5aa3
(apro) [!_WIN32]: Silently ignore directory entries starting with '.'.
...
Before, apro() logged complaints about . and .. not being regular
files.
2006-09-23 15:00:01 +00:00
7a2aad83cb
Clean up the previous revision.
2006-09-23 13:25:46 +00:00
25dece0a3d
(produce_sect): Game state changes may be changed only if
...
player->simulation. Fix a missing guard. Existing callers should not
need it.
2006-09-23 10:47:58 +00:00
8da88626d5
(produce_sect, finish_sects): Move stop order expiry to end of update,
...
so that stopped sectors don't repair units. The update sequence
masked this bug until its change in src/lib/update/main.c rev. 1.25,
but use of budget priorities (gone since rev. 1.24) could unmask it.
2006-09-23 10:37:55 +00:00
e121d1bdc0
(sect_has_dock): NAV_CANAL in sect.h rev. 1.36 broke loading in
...
canals, fix. Can't enforce M_CANAL condition here, so leave it to
callers. Callers don't enforce it either, which means landlocked
ships can load in canals. Oh well.
2006-09-23 09:09:43 +00:00
c9f21c0e73
(player_main): Delay journal_login() until after error exits, to
...
ensure it is properly paired with journal_logout().
2006-09-23 08:58:54 +00:00
251f552088
(tend_land): Fix to not let land units be tended that could not be
...
loaded.
2006-09-23 08:40:40 +00:00
Ron Koenderink
eb54f7b574
(genlist): Switch thing to use struct empobj * instead of void *.
...
Remove type from struct genlist as it can be determined from thing.
Users changed.
2006-09-01 23:22:45 +00:00
Ron Koenderink
ebf588b713
(empobj_chr): New, create a new (imcomplete) structure for
...
empobj characteristics.
(get_empobj_chr): Update get_empobj_chr() to use new
struct empobj_chr.
2006-08-18 23:32:45 +00:00
Ron Koenderink
a9a9957a27
(radar): New, moved functionality from rada() except ef_type determination.
...
(rada): Call radar() with EF_SHIP.
(lrad): New, call radar() with EF_LAND.
(empmod[]): Call lrad() for lradar command.
(march, navi): Call radar() with appropriate type.
2006-08-16 01:16:30 +00:00
ed88f3140d
(EF_IS_VIEW): New.
...
(xdump): Use it to deny access to views when denying access to game
state. Fixes the previous revision.
2006-08-13 07:29:30 +00:00
7e474afa32
(obj_nameof): Return safer error value.
...
(get_empobjp, get_empobj_chr, emp_obj_chr_name, get_empobj_mob_max):
Style.
2006-08-13 07:18:11 +00:00
f7233ff841
Allow xdump before break; partial solution for #1417871 :
...
(player_coms): Set xdump's c_permit to VIS.
(xdump): Deny countries that couldn't run xdump before access to game
state.
2006-08-13 07:13:37 +00:00
Ron Koenderink
2742a2db62
(ef_open) [_WIN32]: Add shared.h for MinGW environment,
...
needed for WIN32 file locking. Broken (missed) in rev 1.70.
2006-08-08 22:43:18 +00:00
Ron Koenderink
a89e21037e
(ef_open) [_WIN32]: Provide file locking for WIN32.
2006-08-07 17:15:04 +00:00
Ron Koenderink
db541d9b9b
(rada): Replace the "unit" text with "land" to be more clear.
2006-08-04 19:59:24 +00:00
Ron Koenderink
90ff9ae2b0
(rada): Using struct empobj to generalize the code.
2006-08-02 22:07:12 +00:00