Move light source and timer types so zero means none
Breaks saves and bones.
This commit is contained in:
@@ -17,7 +17,7 @@
|
|||||||
* Incrementing EDITLEVEL can be used to force invalidation of old bones
|
* Incrementing EDITLEVEL can be used to force invalidation of old bones
|
||||||
* and save files.
|
* and save files.
|
||||||
*/
|
*/
|
||||||
#define EDITLEVEL 102
|
#define EDITLEVEL 103
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Development status possibilities.
|
* Development status possibilities.
|
||||||
|
|||||||
+6
-5
@@ -10,11 +10,12 @@ typedef void (*timeout_proc)(ANY_P *, long);
|
|||||||
|
|
||||||
/* kind of timer */
|
/* kind of timer */
|
||||||
enum timer_type {
|
enum timer_type {
|
||||||
TIMER_LEVEL = 0, /* event specific to level [melting ice] */
|
TIMER_NONE = 0,
|
||||||
TIMER_GLOBAL = 1, /* event follows current play [not used] */
|
TIMER_LEVEL = 1, /* event specific to level [melting ice] */
|
||||||
TIMER_OBJECT = 2, /* event follows an object [various] */
|
TIMER_GLOBAL = 2, /* event follows current play [not used] */
|
||||||
TIMER_MONSTER = 3, /* event follows a monster [not used] */
|
TIMER_OBJECT = 3, /* event follows an object [various] */
|
||||||
NUM_TIMER_KINDS /* 4 */
|
TIMER_MONSTER = 4, /* event follows a monster [not used] */
|
||||||
|
NUM_TIMER_KINDS /* 5 */
|
||||||
};
|
};
|
||||||
|
|
||||||
/* save/restore timer ranges */
|
/* save/restore timer ranges */
|
||||||
|
|||||||
+6
-2
@@ -12,8 +12,12 @@
|
|||||||
/*
|
/*
|
||||||
* Light source sources
|
* Light source sources
|
||||||
*/
|
*/
|
||||||
#define LS_OBJECT 0
|
enum ls_sources {
|
||||||
#define LS_MONSTER 1
|
LS_NONE = 0,
|
||||||
|
LS_OBJECT = 1,
|
||||||
|
LS_MONSTER = 2,
|
||||||
|
NUM_LS_SOURCES
|
||||||
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* cansee() - Returns true if the hero can see the location.
|
* cansee() - Returns true if the hero can see the location.
|
||||||
|
|||||||
@@ -103,6 +103,10 @@ del_light_source(int type, anything *id)
|
|||||||
has only been partially restored during a level change
|
has only been partially restored during a level change
|
||||||
(in particular: chameleon vs prot. from shape changers) */
|
(in particular: chameleon vs prot. from shape changers) */
|
||||||
switch (type) {
|
switch (type) {
|
||||||
|
case LS_NONE:
|
||||||
|
impossible("del_light_source:type=none");
|
||||||
|
tmp_id.a_uint = 0;
|
||||||
|
break;
|
||||||
case LS_OBJECT:
|
case LS_OBJECT:
|
||||||
tmp_id.a_uint = id->a_obj ? id->a_obj->o_id : 0;
|
tmp_id.a_uint = id->a_obj ? id->a_obj->o_id : 0;
|
||||||
break;
|
break;
|
||||||
|
|||||||
+4
-1
@@ -1942,6 +1942,9 @@ staticfn const char *
|
|||||||
kind_name(short kind)
|
kind_name(short kind)
|
||||||
{
|
{
|
||||||
switch (kind) {
|
switch (kind) {
|
||||||
|
case TIMER_NONE:
|
||||||
|
impossible("no timer type");
|
||||||
|
return "none";
|
||||||
case TIMER_LEVEL:
|
case TIMER_LEVEL:
|
||||||
return "level";
|
return "level";
|
||||||
case TIMER_GLOBAL:
|
case TIMER_GLOBAL:
|
||||||
@@ -2179,7 +2182,7 @@ start_timer(
|
|||||||
{
|
{
|
||||||
timer_element *gnu, *dup;
|
timer_element *gnu, *dup;
|
||||||
|
|
||||||
if (kind < 0 || kind >= NUM_TIMER_KINDS
|
if (kind <= TIMER_NONE || kind >= NUM_TIMER_KINDS
|
||||||
|| func_index < 0 || func_index >= NUM_TIME_FUNCS)
|
|| func_index < 0 || func_index >= NUM_TIME_FUNCS)
|
||||||
panic("start_timer (%s: %d)", kind_name(kind), (int) func_index);
|
panic("start_timer (%s: %d)", kind_name(kind), (int) func_index);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user