Crossfire Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CF: Re: apply() cleanup



On Thu, May 18, 2000 at 04:35:30PM +0200, Jan Echternach wrote:
> rest of crossfire.  I'm not sure if the patch is already stable enough
> to put it in the CVS tree, because I haven't done any systematic
> testing yet.

I have tested all object types in manual_apply() and move_apply() at
least once and only found one minor bug (object type TRIGGER must be
handled in manual_apply(), not in move_apply()).  The patch has proven
to be very stable.  All serious problems where in other parts of
crossfire, and many of these will be fixed by the apply() cleanup
patch.

I would like to apply the patch to the CVS tree as soon as possible.

Fixing remaining problems (e.g. stepping on magic missiles and thrown
objects was not handled by apply(), and is still not handled by
move_apply()) will be much easier for me with additional patches.

The patch is available from

  http://www.informatik.uni-rostock.de/~echter/cf/

The files you need at least are

  patch13e.gz
  arch7
  arch8

patch13f.gz is equivalent to patch13e.gz except that it is in context
diff format (patch13e.gz is a unified diff) and that it is relative to
the latest CVS version (which only means that line numbers differ,
there were no rejects with patch13e.gz).

The changes are described in

  arch7.comments
  arch8.comments
  patch13b.comments
  patch13d.comments  (relative to patch13b)
  patch13e.comments  (relative to patch13d)

I'll also attach arch7.comments, arch8.comments and patch13e.comments
to this message.

-- 
Jan
QUESTIONS

* apply_container() is unused.  Remove this code?  (It is impossible to test
it - broken for players and broken for monsters.)


CHANGES

* server/apply.c: Bugfix: Don't skip calls to change_skill() if wizard -
calc_skill_exp() requires change_skill() to set the current experience object.

* server/monster.c: find_mon_throw_ob():  Bugfix: Unapply applied object even
if heaviest object was choosen.
Bugfix: Use monster_apply_special() to unapply, clearing FLAG_APPLIED isn't
enough. -> Should fix the "HAS_READY_BOW without bow" errors.
* server/skills.c: find_throw_ob():  Bugfix: Use player_apply(), clearing
FLAG_APPLIED isn't enough.
Replace redundant check for FLAG_INV_LOCKED with error message at end of
function if the first check failed somehow and we have choosen an object with
FLAG_INV_LOCKED.
make_throw_ob(): error message if object is applied

* lib/checkarch.pl: check that potions (type 5, POTION) have a level

* server/apply.c: apply_special(): Handle all cases of applying and unapplying
skill objects.
* server/apply.c: manual_apply(SKILL): Just call apply_special().
* server/skill_util.c: change_skill(): Rewrite to simply use apply_special()
for changing skills.

* server/apply.c: apply_special(): Bugfix: Fixed return values.

* server/skill_util.c: link_player_skills(): Bugfix: Don't set exp_obj for
(visible) skill tools.
* server/skill_util.c: link_player_skills(): Bugfix? Reset op->chosen_skill
and FLAG_READY_SKILL because we have unapplied all skills.
* server/input.c: legal_range(): Bugfix: range_skill is valid only if
op->chosen_skill != NULL, not when there is some (unapplied) skill somewhere
in the inventory.
* server/login.c: check_login(): Bugfix: call legal_range() after
init_player_skills() - we can't handle range_skill correctly if skills haven't
been initialized.
* server/login.c: check_login(): Bugfix: Check return value of legal_range(),
and reset op->contr->shoottype to range_none if range was invalid.
* server/login.c: check_login(): Bugfix: Don't call fix_weight() - fixing
the weight of _all_ players isn't necessary.  Just initialize op->carrying
directly with sum_weight() instead.  This also removes the problem of
updating the weight of an object that hasn't been sent to the client yet.
* server/login.c: check_login(): Bugfix: We need to call fix_player()
(init_player_skills() needs this, and it also makes the code more robust).

* server/apply.c: apply_altar(): Bugfix: Print altar's message before
casting the spell.

* server/spell_util.c: move_cone(): Use copy_owner() instead of set_owner()
and manually correcting the skill and experience object pointers.
* server/spell_util.c: cast_cone(): Don't set FLAG_FLYING - the archetype
needs to have this anyway for move_cone() to work properly.  Instead, print
error messages if FLAG_FLYING, FLAG_WALK_ON or FLAG_FLY_ON are missing.

* server/apply.c: move_apply(): TRAPDOOR: Bugfix: Multiply by op->nrof when
calculating the weight.

[* server/apply.c: Bugfix: TRIGGER must be handled by manual_apply(), not
move_apply()]

* randommaps/standalone.c, server/apply.c: fix_auto_apply(): Bugfix: Don't
call check_trigger() for objects of type TRIGGER.  For other trigger types,
call check_trigger() only if there is an object above the trigger.
This can be used to implement doors that are only open shortly after the map
has been loaded.
* common/button.c: check_trigger(): Many changes.  The triggers should now
behave as described in crossfire.doc.

Broken maps: (dangerous means you can trap yourself accidently)
/asyvan/gate9 (problem or feature?)
/city/anthony/prison
/city/misc/prison
/city/misc/mercenaries (dangerous!)
/city/towers/tower.mad2 (? now only works with two players)
/dragonisland/advguild (dangerous!)
/dragonisland/apartment2 (dangerous!)
/dragonisland/bloodwell (dangerous!)
/dragonisland/drowmansion (dangerous!)
/dragonisland/keysale (dangerous!)
/dtabb/caterham/circus/double (dangerous!)
/espen/church.4b
/langley/town/church
/navar_city/city1enter (dangerous!)
/navar_city/city1prison (dangerous!)
/navar_city/collosium
/peterm/Demonology/Demon3 (dangerous!)
/pup_land/* ??? don't know

/test/anthony/connected_objects
* Comment about manually applying a button to trigger a magic mouth is no
longer true.
* Comments about missing button triggers are no longer true.
* Comment about trigger gates:  Period of time can be set by op->stats.exp,
is documented in crossfire.doc.
* Trigger altars work multiple times.
/test/anthony/special_objects
* inverted trigger gate(?): a normal trigger should do the same now

* server/monster.c: monster_apply_below(): will_apply & 1 now also applies
TRIGGER objects, not only HANDLE objects.  Allows an interesting solution for
/asyvan/gate9 if there is no second player who can open the middle grate.

* common/button.c: check_trigger(TRIGGER_PEDESTAL) and update_button(PEDESTAL):
Bugfix: Handle objects with heads correctly.

* server/c_object.c: drop_object() and socket/item.c: look_at(): Bugfix: If a
player is moved on top with remove_ob()/insert_ob_in_map(), FLAG_NO_APPLY must
be set temporarily.
* common/object.c: remove_ob(): Bugfix: Don't call move_apply_func() if
FLAG_NO_APPLY is set.

* server/apply.c: manual_apply(): Don't call apply_special() for objects
that are not in the inventory.  Return 2 in this case.
* server/apply.c: player_apply_below(): Skip objects for which manual_apply()
returned 2.

* server/apply.c: apply_spellbook(): Bugfix: Don't give experience for items
with FLAG_STARTEQUIP.
Added level 1 to all archetypes with type 88 (CONE) that can do damage.

ground/chaos.arc, arch chaos and arch major_chaos
ground/lava.arc, arch lava and arch permanent_lava
Added walk_on 1.

ground/chaos_ball.arc, arch chaos_ball
magic/banishment.arc, arch banishment
magic/colorspray.arc, arch color_spray
magic/counterspell.arc, arch counterspell
magic/face_of_death.arc, arch face_of_death
magic/shockwave.arc, arch shockwave
dev/unused/0.91.1/Flyingnote/flyingnote.arc, arch flyingnote
magic/Cold/icestorm.arc, arch icestorm
magic/Fire/firebreath.arc, arch firebreath
magic/Effect/confuse.arc, arch confuse
magic/Effect/fear.arc, arch fear
magic/Effect/holy_word.arc, arch holy_word
magic/Effect/paralyze.arc, arch paralyze
magic/Effect/slow.arc, arch slow
magic/Effect/turnundead.arc, arch turn_undead
magic/Mana/manablast.arc, arch manablast
Added walk_on 1 and fly_on 1.
connect/trig_altar.arc
connect/trig_lever.arc
connect/trig_pedes.arc
Changes to support bug fixes for trigger types:  Replace speed with exp.
Set is_animated 0.  Remove last face from animation sequence.

connect/trig_altar.arc
Bugfix:  Faces where swapped.

connect/trig_button.arc, arch button_trigger
New archetype.