… | |
… | |
16 | |
16 | |
17 | You should have received a copy of the GNU General Public License |
17 | You should have received a copy of the GNU General Public License |
18 | along with this program; if not, write to the Free Software |
18 | along with this program; if not, write to the Free Software |
19 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
19 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
20 | |
20 | |
21 | The authors can be reached via e-mail at crossfire-devel@real-time.com |
21 | The authors can be reached via e-mail at <crossfire@schmorp.de> |
22 | */ |
22 | */ |
23 | |
23 | |
24 | /* |
24 | /* |
25 | * General convenience functions for crossfire. |
25 | * General convenience functions for crossfire. |
26 | */ |
26 | */ |
… | |
… | |
200 | } |
200 | } |
201 | |
201 | |
202 | /* decay and destroy persihable items in a map */ |
202 | /* decay and destroy persihable items in a map */ |
203 | |
203 | |
204 | void |
204 | void |
205 | decay_objects (mapstruct *m) |
205 | decay_objects (maptile *m) |
206 | { |
206 | { |
207 | int x, y, destroy; |
207 | int x, y, destroy; |
208 | object *op, *otmp; |
208 | object *op, *otmp; |
209 | |
209 | |
210 | if (m->unique) |
210 | if (m->unique) |
… | |
… | |
543 | strcpy (input, tmp); |
543 | strcpy (input, tmp); |
544 | |
544 | |
545 | return; |
545 | return; |
546 | } |
546 | } |
547 | |
547 | |
|
|
548 | ///////////////////////////////////////////////////////////////////////////// |
|
|
549 | |
|
|
550 | #if 0 |
|
|
551 | refcounted *refcounted::rc_first; |
|
|
552 | |
|
|
553 | refcounted::refcounted () |
|
|
554 | { |
|
|
555 | refcnt = 0; |
|
|
556 | rc_next = rc_first; |
|
|
557 | rc_first = this; |
|
|
558 | } |
|
|
559 | |
|
|
560 | refcounted::~refcounted () |
|
|
561 | { |
|
|
562 | assert (!rc_next); |
|
|
563 | assert (!refcnt); |
|
|
564 | } |
|
|
565 | #endif |
|
|
566 | |
548 | void *alloc (int s) throw (std::bad_alloc) |
567 | void *alloc (int s) throw (std::bad_alloc) |
549 | { |
568 | { |
550 | void *p = g_slice_alloc (s); |
569 | void *p = g_slice_alloc (s); |
551 | |
570 | |
552 | if (!p) |
571 | if (!p) |
… | |
… | |
577 | } |
596 | } |
578 | else |
597 | else |
579 | memcpy (dst, src, len + 1); |
598 | memcpy (dst, src, len + 1); |
580 | } |
599 | } |
581 | |
600 | |
|
|
601 | |