--- crossfire/common ---


Protocol:pserver User:anonymous
Machine:crossfire.cvs.sourceforge.net CVSROOT:/cvsroot/crossfire

Filename: button.c
Revision 1.32mwedel 2006/07/05 23:22:20 +22 -12
common/button.c: Fix for sourceforge bug common/button.c - harpsicord crashes
client. The problem is that the trigger code presumed that the object
would be animated, and blindly set teh face to the second animation frame.
harpsicords are not animated, so this could amount to garbage. So add
check for trigger objects to see if they are in fact animated before
blindly setting the face.
MSW 2006-07-05
Show difference between Revision 1.31 and 1.32
Revision 1.31akirschbaum 2006/02/08 18:48:36 +6 -6
Apply patch #1427979 (code-cleanup: add const, fix warnings) by Stefan
Huehner.
Show difference between Revision 1.30 and 1.31
Revision 1.30mwedel 2005/11/16 02:16:00 +134 -108
Commit for new blocking code. Not going to dictate all the changes -
but will outline the broad points. Note also that the
doc/Developers/objects is updated and goes into more details also.
- check for P_WALL no longer used - instead, need to use GET_MAP_MOVE_BLCOK
and check against movement type of objects.
- arch_blocked() changed to ob_blocked(), now takes object. Needed because
just looking at archetype move_ values is no longer sufficient.
- find_first_free_spot() changed to take object, since it just calls
arch_blocked()
- FLAG_FLYING removed, now in move type.
- walk_on/walk_off/fly_on/fly_off removed - now based on move_on and
move_off fields.
- Map space structure extended to hold the move_on/move_off, etc
values so that we can shortcut some processing by not having to
check every object on the space when something enters it if
move_on isn't set.
- archetypes recollected - boulders needed move_walk to properly trigger
buttons.
- Note that the new plugin code has to be fixed up for the new movement
code. Look for FIXME in plugins/cfpython/cfpython_object.c
MSW 2005-11-15
Show difference between Revision 1.29 and 1.30
Revision 1.29ryo_saeba 2005/10/01 11:36:35 +2 -2
Clean some compilation warnings.
Show difference between Revision 1.28 and 1.29
Revision 1.28mwedel 2005/09/13 01:46:35 +3 -3
This change is mostly cosmetic and a preparation for the new movement
type code. Basically, it just changes the old object movement_type
field to attack_movement. This makes sense because that is what that
field is called in saved and loaded objects/archetypes, and thus
frees up that name for the new movement code.
--
common/button.c: field name change
common/loader.{cl}: field name change
doc/Developers/objects: Add section on new movement types, update old
documentation to note it is attack_movement and not movement_type
field that is important.
include/object.h: field name change.
server/attack.c: field name change.
server/monster.c: field name change
server/pets.c: field name change
server/skills.c: field name change.
server/spell_attack.c: field name change
server/spell_effect.c: field name change
MSW 2005-09-12
Show difference between Revision 1.27 and 1.28
Revision 1.27tchize 2005/09/03 15:42:01 +3 -2

Changed altar behaviour. Now altar can check also against fullname of object.
examples are:
slaying bronze sword +2
slaying diamond of exceptional beauty
Show difference between Revision 1.26 and 1.27
Revision 1.26ryo_saeba 2005/07/15 08:51:48 +8 -8
Glue cleaning. New plugin function.
Show difference between Revision 1.25 and 1.26
Revision 1.25akirschbaum 2005/07/14 04:18:53 +2 -2
common/{button.c, treasure.c, utils.c}, server/{c_wiz.c, login.c, shop.c,
skill_util.c, spell_effect.c}, socket/{image.c, item.c}: Fix printf like
format specifiers. At least one of them fixes a means to crash the server.
Andreas Kirschbaum 2005-07-14
Show difference between Revision 1.24 and 1.25
Revision 1.24mwedel 2004/04/18 02:59:36 +5 -2
common/button.c: Patch by Bernd Edler to have proper speed set for items
activated by buttons.
server/apply.c: Apply the 'special prayer' marker stuff, since it wasn't
used anymore.
server/gods.c: Check for FLAG_EQUIP on spells and not for a special prayer
marker to guess if a spell is a god given spell or not.
server/spell_util.c: Patch by Bernd Edler so that firewalls are immune
to casting time.
MSW 2004-04-17
Show difference between Revision 1.23 and 1.24
Revision 1.23temitchell 2003/10/26 21:44:33 +5 -1
- Add TRIGGER_MARKER object (type 52)
a MARKER that can activated by a connected trigger.
Show difference between Revision 1.22 and 1.23
Revision 1.22mwedel 2003/10/07 02:02:01 +10 -4
TODO: various updates.
common/button: Old patch by David Seikel: change inventory checkers so that
the monster/player is also checked against. And do more proper for checkers
that check against slaying or race - if the trigger doesn't have
those set, we don't want to compare a null against another null and
get success).
server/apply.c: Change apply_shop_mat() so that it removes unpaid objects from
monsters (or thrown containers for that matter). Old patch by Bernd Edler
to improve messages dragons get for eating various food types.
server/player.c: Add another missing call to fix_player(). Modify
move_player_attack() so that the target player doesn't hit back if
they are the WIZ or on a battleground
MSW 2003-10-06
Show difference between Revision 1.21 and 1.22
Revision 1.21mwedel 2003/09/13 00:01:26 +5 -3
Updated code for skill + spell code. skills and spells are now objects.
tuning these now means changing the archetypes. New spells can now
be added just by making a new archetype. Lots of code cleanup
also done.
MSW 2003-09-12
Show difference between Revision 1.20 and 1.21
Revision 1.20garbled 2003/01/16 22:38:35 +5 -1
Add a duplicator/multiplier/destroyer object type. This will duplicate a
specific arch when triggered, and that arch is on top of the duplicator.
It will multiply the number of items in the pile, by the level of the
duplicator. If the duplicator is set to level 0, it will destroy the object.
Show difference between Revision 1.19 and 1.20
Revision 1.19mwedel 2002/09/18 01:17:19 +93 -68
Various updates:
NOTE - You need to install the updated archetypes (included below)
if you run this code without the updated archs, you will likely find
many things do not work.
acinclude.m4 aclocal.m4 configure: more refinements for libpython detection.
common/button.c: Two push_button() changes - have it check for ACTIVATE_ON_
PUSH/RELEASE to determine if the object should get activated. Also,
change behaviour of TIMED_GATE so that multipart timed gates work.
common/loader.l, loader.c: Update with acttivate_on_push/release
doc/Developers/objects: Add notes about how to add flags to objects.
include/define.h: add new FLAG_ values
include/win32.h: update by pstolarc so it compiles on Win32.
lib/archetypes: rebuilt
MSW 2002-09-17
Show difference between Revision 1.18 and 1.19
Revision 1.18mwedel 2002/09/05 01:19:27 +2 -2
common/button.c: Fix do_mood_floor() to look at all objects on space for
something to effect, not just things above the moodfloor.
MSW 2002-09-11
Show difference between Revision 1.17 and 1.18
Revision 1.17mwedel 2002/07/14 23:25:39 +3 -3
Update banner copyright with proper contact information.
MSW 2002-07-14
Show difference between Revision 1.16 and 1.17
Revision 1.16mwedel 2002/05/31 23:33:10 +11 -10
common/button.c: Fix mood floor code - before, it was changing the moods
of all sorts of objects (luggage, itself, etc). Now, it only
changes objects above the floor, and only monsters.
MSW 2002-05-31
Show difference between Revision 1.15 and 1.16
Revision 1.15mwedel 2001/07/13 23:04:53 +11 -11
common/Makefile.in: Remove ltostr.c and sqrt.c from list of files
common/ltostr.c, common/sqrt.c: Moved into porting.c
common/anim.c, common/button.c, common/item.c: Update calls to update_object
common/living.c: have fix_player calculate light value for player/monster.
common/logger.c: Remove code that has server exit if too many LOG messages
happen too quickly. This was not a reliable mechanism, and it should
really be up to the functions doing the logging to know if they can
continue or not.
common/los.c: Changes on how it deals with lighting on maps - get light
value from map space array instead of using the linked list. Functions
that managed the light list have been removed. Change logic of
line of sight function to be more efficient (before, we may examine
the same space multiple times). rename update_all_los to
update_all_map_los, and change update_all_los to take coordinates
so that we only have clients within view of the change recalculate
los. Also, have update_all_los check for tiled maps that may have
clients that need to get updated.
common/map.c: remove refresh_map - this used to be used to try to recover
from map errors if many_cores was not set - IMO better to core and
just restart and really fix the error than try to deal with possible
corruption that may otherwise result.
Move open_and_uncompress and close_and_delete functions to porting.c -
they are 'common' functions that are not related to the map code.
Remove some lighting related code, as that is no longer done with
a list. Many modifications because of new map structure. And
logic to load and save the new map structure format. Modify
many of the functions to take map tiling into account. Change
way multipart objects are saved, and add logic to relink objects
when maps are loaded up. Remove some functions that are only
used by the editor into the editor. Move update_position from
object.c to map.c as it is better placed in map.c. Modify
function to figure out light for a space. Make out_of_map a
function that knows about map tiling. New function - get_map_from_coord
which knows about map tiling and does coordinate and map translation.
common/object.c: Have update_object take another parameter which tells
update object what has changed about the object. This lets the function
know if it should call update_position right away or if it can just
mark the space as needing an update at a later time. move update_position
to map.c.
insert_ob_in_map: now takes another parameter that describes actions not
to do. modified to know about map tiling and do appropriate translation.
Does some object sorting so it should handle spell objects more
efficiently.
insert_ob_in_map_simple is now replaced by
using appropriate flag to this changed version of insert_ob_in_map.
Clean up remove_ob - seemed to have done things in a more complicated
fashion that is no longer necessary. Modify check_walk_on to look
at all objects on space, not those below the object - with changes to
insert_ob_in_map, new object won't always be on top.
common/porting.c: functions from ltostr.c, sqrt.c, as open_and_uncompress
close_and_delete, make_path_to_file from map.c
common/treasure.c: Modified to use updated insert_ob_in_map
MSW 2001-07-13
Show difference between Revision 1.14 and 1.15
Revision 1.14michtoen 2001/06/11 13:47:05 +2 -2
change HANDLE to CF_HANDLE
Show difference between Revision 1.13 and 1.14
Revision 1.13mardahl 2001/04/11 03:39:53 +2 -2
Fix the spell of peace (spell_effect)
Change the error level from ERROR to DEBUG (button).
--PeterM
Show difference between Revision 1.12 and 1.13
Revision 1.12mwedel 2001/03/19 23:46:18 +8 -2
Fix for crashes caused by golems. Basically, mood floors would
make the golems unfriendly/clear the owner value but not free the
golem pointer in the player structure. MSW 2001-03-19
Show difference between Revision 1.11 and 1.12
Revision 1.11avogl 2001/03/08 18:42:58 +28 -3
common/button.c:

I enabled a new attribute for altar_triggers: "last_sp 1".
If set, the alter_trigger won't push the connected value
by altar reset. If unset ("last_sp 0"), the altar_trigger will
push both by sacrifice and by reset (like it used to be).
--AV
Show difference between Revision 1.10 and 1.11
Revision 1.10avogl 2001/02/25 18:06:21 +6 -8
When a magic_mouth has "food <value>" set, it will
be used up after being triggered <value> times.
But when it is "used up" and is triggered again, the
text is displayed: "there is no message". This is very
annoying and makes the whole thing useless.

Now I patched it so that a "used up" magic_mouth
prints no message when triggered again. It's just
like the magic_mouth would no longer exist.

--AV
Show difference between Revision 1.9 and 1.10
Revision 1.9cvs 2001/01/15 16:33:32 +4 -2
MSW 2000/01/15:
Various fixes for friendly object code:
common/button.c: Add missing call to remove_friendly_object
common/friend.c: Pretty much completely re-written. add_friendly_object now
checks to make sure the object being added isn't already on the list,
remove_friendly_object will remove objects whose tags don't match,
and added clean_friendly_list.
common/object.c: No reason to use the function pointer to
remove_friendly_object since that function is in the lib.
common/time.c: Make DEBUG_TIME always on (no longer compile time option).
other areas use the global var pticks, so if it was turned off, compile
would break anyways.
common/treasuer.c: No longer print debug messages on artifacts created.
Cluttered log file making it hard to see more important errors.
include/config.h: Remove DEBUG_TIME define.
include/libproto.h: Rebuilt for clean_friendly_list function.
server/main.c: rewrote do_specials to do things based on pticks variable.
This allows various specials to be spread out across multiple ticks
easier. Also, added clean_friendly_function to part of what this does.
server/skills.c: add missing call to remove_friendly_object. Also, removed
from #if 0 .. #else .. #endif code.
End of MSW 2000/01/15 checkin.
Show difference between Revision 1.8 and 1.9
Revision 1.8cvs 2000/12/06 00:02:56 +2 -2
MSW 2000/12/5
Do not set path_attuned when loading connected objects from within
the editor. This is normally done for random map code/glue logic.
Show difference between Revision 1.7 and 1.8
Revision 1.7cvs 2000/12/03 18:40:03 +3 -4
Checking for partial resistance code. Various minor errors also fixed
(compiler warnings, unused variables, Makefile.in changes, etc).
PR code also includes support to send protections to the client.
Show difference between Revision 1.6 and 1.7
Revision 1.6cvs 2000/06/18 19:42:32 +3 -1
common/button.c: I needed to use a field to store 'connected' values
so I could copy sections of one map into another and have connectedness
preserved. --PeterM

lib/treasures: new treasure type "random_coin" for a style map. --PeterM
Show difference between Revision 1.5 and 1.6
Revision 1.5cvs 2000/06/16 01:06:33 +4 -1
Modified how firewalls worked. Can now trigger them with handles.
Show difference between Revision 1.4 and 1.5
Revision 1.4jec 2000/06/08 11:08:41 +5 -2
common/button.c: do_mood_floor(): Bugfixes: Only players can have pets.
Call add_friendly_object() for friendly monsters.

server/spell_effect.c and server/spell_util.c: Several functions: Only
add a pet if there really is a pet's owner, and it's a player.

server/spell_effect.c: cast_charm() and cast_charm_undead(): Bugfixes:
Only players can cast these spells. This fixes server crash if
a monster casted a charm spell, and the charmed pet was killed.
Call add_friendly_object for friendly monsters.

common/friend.c: remove_friendly_object(): Use llevError for error
messages.

common/living.c: fix_player(); server/gods.c: tailor_god_spell();
server/spell_effect.c: summon_avatar() and animate_weapon(): Bugfix: Set
a string to NULL after calling free_string(). This fixes a nasty bug
that caused the string's reference count drop below 0, which resulted
in corruption of malloc()'s internal data structures (and possibly
server crashes).

server/time.c: move_creator(): Bugfix: Call free_string() to free old
values of op->name and op->title before overwriting them with new values.

common/object.c: insert_ob_in_map_simple() and insert_ob_in_map():
Check that we don't insert freed objects.

server/attack.c: hit_player_attacktype() and hit_player(): Bugfix: Check
that find_god() really found a god, and that 'god->slaying' is not NULL.
Fixes crash if a monster casted turn undead and actually hit something.

server/attack.c: hit_player(): Check that a pet's owner is a player.
Prevents server crashes if a monster has a pet monster due to a bug
somewhere. Use llevError for error message.

server/time.c: move_arrow(): Use llevDebug level for "Arrow had no
map" message.

server/c_object.c, server/spell_effect.c, server/spell_util.c: Bugfixes:
Added some missing checks for destroyed objects. Use was_destroyed()
or return value of insert_ob_in_map() to check for destroyed objects,
not FLAG_FREED or FLAG_REMOVED. Don't use op->count of destroyed objects.

server/shop.c: get_payment2(): Type of tag is 'tag_t', not 'long'.

server/spell_effect.c: animate_bomb(): Fix environment checks.

server/spell_util.c: fire_bolt(): Bugfix: Set level of bolt.

server/spell_util.c: explosion(): Bugfix: Set FLAG_NO_APPLY before
moving the exploding object to the top.

server/spell_util.c: put_a_monster(): First create the monster
completely, then just insert its head.

server/time.c: generate_monster(): Bugfix: Don't free generators that
are used up in this function. process_object() already does this.
This fixes steambolt (which is a generator but must not used up here -
generate_monster() wasn't looking at FLAG_IS_USED_UP) and all generators
which should really be used up (because process_object() didn't expect
generate_monster() to destroy the object).
Show difference between Revision 1.3 and 1.4
Revision 1.3jec 2000/05/26 04:50:45 +127 -75
* apply() cleanup patch 26/5/2000
Show difference between Revision 1.2 and 1.3
Revision 1.2cvs 1999/07/13 01:02:41 +0 -0

Global commit for 0.95.4 - most files have no changes but just have
differing headers between my local RCS and the CVS versions and need to
get synced up.
Show difference between Revision 1.1 and 1.2
Revision 1.1uid200 1999/04/02 13:10:03 None
Initial revision
First version
Revision 1.1.1.1uid200 1999/04/02 13:10:03 +0 -0
First CVS revsion: crossfire-0.95.3
Show difference between Revision 1.1 and 1.1.1.1


File made using version 1.98 of cvs2html by leaf at 2011-07-21 17:06