Crossfire Server, Branch 1.12  R12190
Defines | Typedefs
Movement types and related macros.

Those flags are all possible movement types. More...

Defines

#define MOVE_ALL   0x1f
 Mask of all movement types.
#define MOVE_BLOCK_DEFAULT   MOVE_SWIM
 The normal assumption is that objects are walking/flying.
#define MOVE_BOAT   0x10
 Boats/sailing.
#define MOVE_FLY_HIGH   0x4
 High flying object.
#define MOVE_FLY_LOW   0x2
 Low flying object.
#define MOVE_FLYING   0x6
 Combo of fly_low and fly_high.
#define MOVE_SWIM   0x8
 Swimming object.
#define MOVE_WALK   0x1
 Object walks.
#define OB_MOVE_BLOCK(ob1, ob2)   ((ob1->move_type&ob2->move_block) == ob1->move_type)
 Basic macro to see if ob2 blocks ob1 from moving onto this space.
#define OB_TYPE_MOVE_BLOCK(ob1, type)   ((type != 0) && (ob1->move_type&type) == ob1->move_type)
 Basic macro to see if if ob1 can not move onto a space based on the 'type' move_block parameter Add check - if type is 0, don't stop anything from moving onto it.

Typedefs

typedef unsigned char MoveType
 Typdef here to define type large enough to hold bitmask of all movement types.

Detailed Description

Those flags are all possible movement types.

If you add new movement types, you may need to update describe_item() so properly describe those types. change_abil() probably should be updated also.


Define Documentation

#define MOVE_ALL   0x1f

The normal assumption is that objects are walking/flying.

So often we don't want to block movement, but still don't want to allow all types (swimming is rather specialized) - I also expect as more movement types show up, this is likely to get updated. Basically, this is the default for spaces that allow movement - anything but swimming right now. If you really want nothing at all, then can always set move_block to 0

Definition at line 667 of file define.h.

Referenced by put_decor(), surround_flag3(), unblock_exits(), and wall_blocked().

#define MOVE_BOAT   0x10

Boats/sailing.

Definition at line 655 of file define.h.

Referenced by initConstants().

#define MOVE_FLY_HIGH   0x4

High flying object.

Definition at line 652 of file define.h.

Referenced by change_abil(), describe_item(), fix_object(), initConstants(), and insert_ob_in_map().

#define MOVE_FLY_LOW   0x2
#define MOVE_FLYING   0x6
#define MOVE_SWIM   0x8

Swimming object.

Definition at line 654 of file define.h.

Referenced by change_abil(), describe_item(), and initConstants().

#define MOVE_WALK   0x1
#define OB_MOVE_BLOCK (   ob1,
  ob2 
)    ((ob1->move_type&ob2->move_block) == ob1->move_type)

Basic macro to see if ob2 blocks ob1 from moving onto this space.

Basically, ob2 has to block all of ob1 movement types.

Definition at line 681 of file define.h.

Referenced by blocked_link(), roll_ob(), and try_fit().

#define OB_TYPE_MOVE_BLOCK (   ob1,
  type 
)    ((type != 0) && (ob1->move_type&type) == ob1->move_type)

Basic macro to see if if ob1 can not move onto a space based on the 'type' move_block parameter Add check - if type is 0, don't stop anything from moving onto it.

Definition at line 690 of file define.h.

Referenced by attempt_jump(), blocked_link(), cast_create_obj(), cast_light(), check_bullet(), common_process_projectile(), dimension_door(), fire_arch_from_position(), fire_bolt(), fire_bullet(), forklightning(), move_aura(), move_ball_spell(), move_bolt(), move_bullet(), move_missile(), ob_blocked(), ok_to_put_more(), path_to_player(), pet_move(), skill_attack(), stand_near_hostile(), steal(), and teleport().


Typedef Documentation

typedef unsigned char MoveType

Typdef here to define type large enough to hold bitmask of all movement types.

Make one declaration so easy to update. uint8 is defined yet, so just use what that would define it at anyways.

Definition at line 675 of file define.h.