]> git.pond.sub.org Git - empserver/commit
Disable some incorrect uses of supply_commod()
authorMarkus Armbruster <armbru@pond.sub.org>
Thu, 24 Apr 2008 18:18:23 +0000 (20:18 +0200)
committerMarkus Armbruster <armbru@pike.pond.sub.org>
Wed, 7 May 2008 08:33:42 +0000 (10:33 +0200)
commitf7d61817176b166a837961410026f1d028b3be24
tree75bc9c3257607c3f0d6e6e0741a651c8cb1e261b
parentb313b61cd431b4260204ccf2b912b768efef0212
Disable some incorrect uses of supply_commod()

Because supply_commod() updates supply sources it used, the caller
must not cache objects that could be supply sources across a supply
call.  This is very easy to get wrong.

ac_doflak() supplies flak shells if the sector hasn't enough for its
guns.  It caches the sector that receives them.  If the sector has
some shells, but not enough, it supplies them to itself, causing it to
be updated from within supply_commod().  ac_doflak() then adds the
supplied shells to its cached sector, then writes that back.  This
doubles shells already there, and triggers a a seqno mismatch oops.

shp_missile_defense() has similar problems, only for ships.

Disable ac_doflak() and shp_missile_defense() for now, to at least
reduce the oopsing to manageable levels.

Most likely other calls of supply_commod() are also wrong.  Many of
them can't be just disabled, because supply is too relevant to
gameplay there.
src/lib/subs/aircombat.c
src/lib/subs/shpsub.c