… | |
… | |
104 | attachable::~attachable () |
104 | attachable::~attachable () |
105 | { |
105 | { |
106 | assert (!(flags & F_BORROWED)); |
106 | assert (!(flags & F_BORROWED)); |
107 | } |
107 | } |
108 | |
108 | |
|
|
109 | int |
|
|
110 | attachable::refcnt_cnt () const |
|
|
111 | { |
|
|
112 | return refcnt + (self ? SvREFCNT (self) : 0); |
|
|
113 | } |
|
|
114 | |
|
|
115 | void |
109 | void attachable::optimise () |
116 | attachable::optimise () |
110 | { |
117 | { |
111 | if (self |
118 | if (self |
112 | && SvREFCNT (self) == 1 |
119 | && SvREFCNT (self) == 1 |
113 | && !HvTOTALKEYS (self)) |
120 | && !HvTOTALKEYS (self)) |
114 | { |
121 | { |
… | |
… | |
165 | |
172 | |
166 | flags |= F_DESTROYED; |
173 | flags |= F_DESTROYED; |
167 | do_destroy (); |
174 | do_destroy (); |
168 | } |
175 | } |
169 | |
176 | |
|
|
177 | void |
170 | void attachable::check_mortals () |
178 | attachable::check_mortals () |
171 | { |
179 | { |
172 | for (int i = 0; i < mortals.size (); ) |
180 | for (int i = 0; i < mortals.size (); ) |
173 | { |
181 | { |
174 | attachable *obj = mortals [i]; |
182 | attachable *obj = mortals [i]; |
175 | |
183 | |
… | |
… | |
2046 | list () |
2054 | list () |
2047 | PPCODE: |
2055 | PPCODE: |
2048 | for_all_players (pl) |
2056 | for_all_players (pl) |
2049 | XPUSHs (sv_2mortal (to_sv (pl))); |
2057 | XPUSHs (sv_2mortal (to_sv (pl))); |
2050 | |
2058 | |
2051 | bool |
|
|
2052 | peaceful (player *pl, bool new_setting = 0) |
|
|
2053 | PROTOTYPE: $;$ |
|
|
2054 | CODE: |
|
|
2055 | RETVAL = pl->peaceful; |
|
|
2056 | if (items > 1) |
|
|
2057 | pl->peaceful = new_setting; |
|
|
2058 | OUTPUT: |
|
|
2059 | RETVAL |
|
|
2060 | |
|
|
2061 | living * |
|
|
2062 | orig_stats (player *pl) |
|
|
2063 | CODE: |
|
|
2064 | RETVAL = &pl->orig_stats; |
|
|
2065 | OUTPUT: RETVAL |
|
|
2066 | |
|
|
2067 | living * |
|
|
2068 | last_stats (player *pl) |
|
|
2069 | CODE: |
|
|
2070 | RETVAL = &pl->last_stats; |
|
|
2071 | OUTPUT: RETVAL |
|
|
2072 | |
|
|
2073 | |
2059 | |
2074 | MODULE = cf PACKAGE = cf::map PREFIX = cf_map_ |
2060 | MODULE = cf PACKAGE = cf::map PREFIX = cf_map_ |
2075 | |
2061 | |
2076 | int invoke (maptile *map, int event, ...) |
2062 | int invoke (maptile *map, int event, ...) |
2077 | CODE: |
2063 | CODE: |