1 | /* |
1 | /* |
2 | * This file is part of Crossfire TRT, the Roguelike Realtime MORPG. |
2 | * This file is part of Deliantra, the Roguelike Realtime MMORPG. |
3 | * |
3 | * |
4 | * Copyright (©) 2005,2006,2007 Marc Alexander Lehmann / Robin Redeker / the Crossfire TRT team |
4 | * Copyright (©) 2005,2006,2007,2008 Marc Alexander Lehmann / Robin Redeker / the Deliantra team |
5 | * Copyright (©) 2002,2007 Mark Wedel & Crossfire Development Team |
5 | * Copyright (©) 2002,2007 Mark Wedel & Crossfire Development Team |
6 | * Copyright (©) 1992,2007 Frank Tore Johansen |
6 | * Copyright (©) 1992,2007 Frank Tore Johansen |
7 | * |
7 | * |
8 | * Crossfire TRT is free software: you can redistribute it and/or modify |
8 | * Deliantra is free software: you can redistribute it and/or modify it under |
9 | * it under the terms of the GNU General Public License as published by |
9 | * the terms of the Affero GNU General Public License as published by the |
10 | * the Free Software Foundation, either version 3 of the License, or |
10 | * Free Software Foundation, either version 3 of the License, or (at your |
11 | * (at your option) any later version. |
11 | * option) any later version. |
12 | * |
12 | * |
13 | * This program is distributed in the hope that it will be useful, |
13 | * This program is distributed in the hope that it will be useful, |
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16 | * GNU General Public License for more details. |
16 | * GNU General Public License for more details. |
17 | * |
17 | * |
18 | * You should have received a copy of the GNU General Public License |
18 | * You should have received a copy of the Affero GNU General Public License |
19 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
19 | * and the GNU General Public License along with this program. If not, see |
|
|
20 | * <http://www.gnu.org/licenses/>. |
20 | * |
21 | * |
21 | * The authors can be reached via e-mail to <crossfire@schmorp.de> |
22 | * The authors can be reached via e-mail to <support@deliantra.net> |
22 | */ |
23 | */ |
23 | |
24 | |
24 | #include <cassert> |
25 | #include <cassert> |
25 | |
26 | |
26 | #include <global.h> |
27 | #include <global.h> |
27 | #include <funcpoint.h> |
|
|
28 | #include <loader.h> |
28 | #include <loader.h> |
29 | |
29 | |
30 | #include <tr1/functional> |
30 | #include <tr1/functional> |
31 | #include <tr1/unordered_map> |
31 | #include <tr1/unordered_map> |
32 | |
32 | |
33 | /* The naming of these functions is really poor - they are all |
|
|
34 | * pretty much named '.._arch_...', but they may more may not |
|
|
35 | * return archetypes. Some make the arch_to_object call, and thus |
|
|
36 | * return an object. Perhaps those should be called 'archob' functions |
|
|
37 | * to denote they return an object derived from the archetype. |
|
|
38 | * MSW 2003-04-29 |
|
|
39 | */ |
|
|
40 | |
|
|
41 | archetype *loading_arch; // ugly flag to object laoder etc. to suppress/request special processing |
33 | archetype *loading_arch; // ugly flag to object loader etc. to suppress/request special processing |
|
|
34 | arch_ptr archetype::empty; |
42 | |
35 | |
43 | // the hashtable |
36 | // the hashtable |
44 | typedef std::tr1::unordered_map |
37 | typedef std::tr1::unordered_map |
45 | < |
38 | < |
46 | const char *, |
39 | const char *, |
… | |
… | |
48 | str_hash, |
41 | str_hash, |
49 | str_equal, |
42 | str_equal, |
50 | slice_allocator< std::pair<const char *const, arch_ptr> > |
43 | slice_allocator< std::pair<const char *const, arch_ptr> > |
51 | > HT; |
44 | > HT; |
52 | |
45 | |
53 | static HT ht (5000); |
46 | static HT ht (10000); |
54 | archvec archetypes; |
47 | archvec archetypes; |
|
|
48 | static unordered_vector<archetype *> allarch; |
|
|
49 | static int dirtycnt; |
|
|
50 | |
|
|
51 | // the vector of other_arch references to be resolved |
|
|
52 | static std::vector< std::pair<arch_ptr *, shstr> > postponed_arch_ref; |
|
|
53 | // the vector of loaded but not yet committed archetypes |
|
|
54 | static std::vector<archetype *> postponed_arch; |
55 | |
55 | |
56 | /** |
56 | /** |
57 | * GROS - This function retrieves an archetype given the name that appears |
57 | * GROS - This function retrieves an archetype given the name that appears |
58 | * during the game (for example, "writing pen" instead of "stylus"). |
58 | * during the game (for example, "writing pen" instead of "stylus"). |
59 | * It does not use the hashtable system, but browse the whole archlist each time. |
59 | * It does not use the hashtable system, but browse the whole archlist each time. |
… | |
… | |
103 | { |
103 | { |
104 | shstr_cmp skill_cmp (skill); |
104 | shstr_cmp skill_cmp (skill); |
105 | |
105 | |
106 | for_all_archetypes (at) |
106 | for_all_archetypes (at) |
107 | if (at->skill == skill_cmp && (type == -1 || type == at->type)) |
107 | if (at->skill == skill_cmp && (type == -1 || type == at->type)) |
108 | return arch_to_object (at); |
108 | return at->instance (); |
109 | |
109 | |
110 | return 0; |
110 | return 0; |
111 | } |
111 | } |
112 | |
112 | |
113 | /* similiar to above - this returns the first archetype |
113 | /* similiar to above - this returns the first archetype |
… | |
… | |
134 | * - name: The name we're searching for (ex: "writing pen"); |
134 | * - name: The name we're searching for (ex: "writing pen"); |
135 | * Return value: |
135 | * Return value: |
136 | * - a corresponding object if found; a singularity object if not found. |
136 | * - a corresponding object if found; a singularity object if not found. |
137 | * Note by MSW - it appears that it takes the full name and keeps |
137 | * Note by MSW - it appears that it takes the full name and keeps |
138 | * shortening it until it finds a match. I re-wrote this so that it |
138 | * shortening it until it finds a match. I re-wrote this so that it |
139 | * doesn't malloc it each time - not that this function is used much, |
139 | * doesn't allocate it each time - not that this function is used much, |
140 | * but it otherwise had a big memory leak. |
140 | * but it otherwise had a big memory leak. |
141 | */ |
141 | */ |
142 | object * |
142 | object * |
143 | get_archetype_by_object_name (const char *name) |
143 | get_archetype_by_object_name (const char *name) |
144 | { |
144 | { |
… | |
… | |
150 | for (i = strlen (tmpname); i > 0; i--) |
150 | for (i = strlen (tmpname); i > 0; i--) |
151 | { |
151 | { |
152 | tmpname[i] = 0; |
152 | tmpname[i] = 0; |
153 | |
153 | |
154 | if (archetype *at = find_archetype_by_object_name (tmpname)) |
154 | if (archetype *at = find_archetype_by_object_name (tmpname)) |
155 | return arch_to_object (at); |
155 | return at->instance (); |
156 | } |
156 | } |
157 | |
157 | |
158 | return create_singularity (name); |
158 | return create_singularity (name); |
159 | } |
159 | } |
160 | |
160 | |
… | |
… | |
259 | retval = 6; |
259 | retval = 6; |
260 | /* base name matched - not bad */ |
260 | /* base name matched - not bad */ |
261 | else if (strcasecmp (cp, op->name) == 0 && !count) |
261 | else if (strcasecmp (cp, op->name) == 0 && !count) |
262 | retval = 4; |
262 | retval = 4; |
263 | /* Check for partial custom name, but give a real low priority */ |
263 | /* Check for partial custom name, but give a real low priority */ |
264 | else if (op->custom_name && strstr (op->custom_name, cp)) |
264 | else if (op->custom_name.contains (cp)) |
265 | retval = 3; |
265 | retval = 3; |
266 | |
266 | |
267 | if (retval) |
267 | if (retval) |
268 | { |
268 | { |
269 | if (pl->type == PLAYER) |
269 | if (pl->type == PLAYER) |
… | |
… | |
276 | return 0; |
276 | return 0; |
277 | } |
277 | } |
278 | |
278 | |
279 | archetype::archetype (const char *name) |
279 | archetype::archetype (const char *name) |
280 | { |
280 | { |
281 | stub = true; |
|
|
282 | arch = this; |
281 | arch = this; |
283 | this->archname = this->name = this->name_pl = name; |
282 | this->archname = this->name = this->name_pl = name; |
284 | } |
283 | } |
285 | |
284 | |
286 | archetype::~archetype () |
285 | archetype::~archetype () |
… | |
… | |
289 | } |
288 | } |
290 | |
289 | |
291 | void |
290 | void |
292 | archetype::link () |
291 | archetype::link () |
293 | { |
292 | { |
294 | ht.insert (std::make_pair (archname, this)); |
|
|
295 | |
|
|
296 | if (!archetypes.contains (this)) |
293 | if (!archetypes.contains (this)) |
|
|
294 | { |
297 | archetypes.insert (this); |
295 | archetypes.insert (this); |
|
|
296 | ht.insert (std::make_pair (archname, this)); |
|
|
297 | } |
298 | } |
298 | } |
299 | |
299 | |
300 | void |
300 | void |
301 | archetype::unlink () |
301 | archetype::unlink () |
302 | { |
302 | { |
303 | ht.erase (archname); |
|
|
304 | |
|
|
305 | if (archetypes.contains (this)) |
303 | if (archetypes.contains (this)) |
|
|
304 | { |
306 | archetypes.erase (this); |
305 | archetypes.erase (this); |
|
|
306 | ht.erase (archname); |
|
|
307 | } |
307 | } |
308 | } |
308 | |
309 | |
309 | /* |
310 | /* |
310 | * Finds, using the hashtable, which archetype matches the given name. |
311 | * Finds, using the hashtable, which archetype matches the given name. |
311 | * returns a pointer to the found archetype, otherwise NULL. |
312 | * returns a pointer to the found archetype, otherwise NULL. |
… | |
… | |
323 | else |
324 | else |
324 | return i->second; |
325 | return i->second; |
325 | } |
326 | } |
326 | |
327 | |
327 | archetype * |
328 | archetype * |
328 | archetype::get (const char *name) |
|
|
329 | { |
|
|
330 | if (!name) |
|
|
331 | { |
|
|
332 | LOG (llevError, "null archetype requested\n"); |
|
|
333 | name = "(null)"; |
|
|
334 | } |
|
|
335 | |
|
|
336 | if (loading_arch && !strcmp (&loading_arch->archname, name)) |
|
|
337 | return loading_arch; |
|
|
338 | |
|
|
339 | archetype *at = find (name); |
|
|
340 | |
|
|
341 | if (!at) |
|
|
342 | { |
|
|
343 | at = new archetype (name); |
|
|
344 | at->link (); |
|
|
345 | } |
|
|
346 | |
|
|
347 | return at; |
|
|
348 | } |
|
|
349 | |
|
|
350 | archetype * |
|
|
351 | archetype::read (object_thawer &f) |
329 | archetype::read (object_thawer &f) |
352 | { |
330 | { |
353 | assert (f.kw == KW_object); |
331 | assert (f.kw == KW_object); |
354 | |
332 | |
355 | std::vector<archetype *> parts; |
333 | std::vector<archetype *> parts; |
356 | |
334 | |
357 | coroapi::cede_to_tick_every (10); |
335 | coroapi::cede_to_tick (); |
358 | |
336 | |
359 | for (;;) |
337 | for (;;) |
360 | { |
338 | { |
361 | // the archetype might have been referenced earlier |
|
|
362 | // so try to find an existing stub archetype first |
|
|
363 | archetype *at = find (f.get_str ()); |
339 | archetype *at = new archetype (f.get_str ()); |
364 | |
|
|
365 | if (!at || !at->stub) |
|
|
366 | at = new archetype (f.get_str ()); |
|
|
367 | |
340 | |
368 | f.next (); |
341 | f.next (); |
369 | |
342 | |
370 | #if 0 |
343 | #if 0 |
371 | // implementing it here in the server does neither allow multiple inheritence |
344 | // implementing it here in the server does neither allow multiple inheritence |
… | |
… | |
434 | &new_part->archname, &((archetype *)old_part->head_ ())->archname); |
407 | &new_part->archname, &((archetype *)old_part->head_ ())->archname); |
435 | goto fail; |
408 | goto fail; |
436 | } |
409 | } |
437 | } |
410 | } |
438 | |
411 | |
439 | // deactivate existing archetype |
|
|
440 | for (archetype *at = old_head; at; at = (archetype *)at->more) |
|
|
441 | at->unlink (); |
|
|
442 | |
|
|
443 | // assemble new chain |
412 | // assemble new chain |
444 | new_head->min_x = new_head->max_x = new_head->x; |
413 | new_head->min_x = new_head->max_x = new_head->x; |
445 | new_head->min_y = new_head->max_y = new_head->y; |
414 | new_head->min_y = new_head->max_y = new_head->y; |
446 | |
415 | |
447 | archetype *less = new_head; |
416 | archetype *less = new_head; |
448 | for (auto (p, parts.begin () + 1); p != parts.end (); ++p) |
417 | for (auto (p, parts.begin () + 1); p != parts.end (); ++p) |
449 | { |
418 | { |
450 | archetype *at = *p; |
419 | archetype *at = *p; |
451 | |
420 | |
452 | // some flags get inherited formt he head (probably a lot more) |
421 | // some flags get inherited from the head (probably a lot more) |
453 | // doing it here doesn't feel too cozy, but it allows code |
422 | // doing it here doesn't feel too cozy, but it allows code |
454 | // to ignore head checks for these flags, which saves time |
423 | // to ignore head checks for these flags, which saves time |
455 | at->flag [FLAG_ALIVE] = new_head->flag [FLAG_ALIVE]; |
424 | at->flag [FLAG_ALIVE] = new_head->flag [FLAG_ALIVE]; |
456 | at->flag [FLAG_NO_PICK] = new_head->flag [FLAG_NO_PICK]; |
425 | at->flag [FLAG_NO_PICK] = new_head->flag [FLAG_NO_PICK]; |
457 | at->flag [FLAG_MONSTER] = new_head->flag [FLAG_MONSTER]; |
426 | at->flag [FLAG_MONSTER] = new_head->flag [FLAG_MONSTER]; |
458 | at->flag [FLAG_IS_FLOOR] = new_head->flag [FLAG_IS_FLOOR]; |
427 | at->flag [FLAG_IS_FLOOR] = new_head->flag [FLAG_IS_FLOOR]; |
459 | |
428 | |
460 | if (at->x < new_head->min_x) new_head->min_x = at->x; |
429 | new_head->min_x = min (new_head->min_x, at->x); |
461 | if (at->y < new_head->min_y) new_head->min_y = at->y; |
430 | new_head->min_y = min (new_head->min_y, at->y); |
462 | if (at->x > new_head->max_x) new_head->max_x = at->x; |
431 | new_head->max_x = max (new_head->max_x, at->x); |
463 | if (at->y > new_head->max_y) new_head->max_y = at->y; |
432 | new_head->max_y = max (new_head->max_y, at->y); |
464 | |
433 | |
465 | at->head = new_head; |
434 | at->head = new_head; |
466 | less->more = at; |
435 | less->more = at; |
467 | less = at; |
436 | less = at; |
468 | } |
437 | } |
469 | |
438 | |
470 | // now activate it |
439 | postponed_arch.insert (postponed_arch.end (), parts.begin (), parts.end ()); |
471 | for (auto (p, parts.begin ()); p != parts.end (); ++p) |
|
|
472 | { |
|
|
473 | archetype *at = *p; |
|
|
474 | at->stub = false; |
|
|
475 | at->link (); |
|
|
476 | } |
|
|
477 | |
440 | |
478 | return new_head; |
441 | return new_head; |
479 | } |
442 | } |
480 | |
443 | |
481 | fail: |
444 | fail: |
482 | for (auto (p, parts.begin ()); p != parts.end (); ++p) |
445 | for (auto (p, parts.begin ()); p != parts.end (); ++p) |
483 | (*p)->destroy (true); |
446 | (*p)->destroy (); |
484 | |
447 | |
485 | return 0; |
448 | return 0; |
486 | } |
449 | } |
487 | |
450 | |
488 | /* |
|
|
489 | * Initialize global archtype pointers: |
|
|
490 | */ |
|
|
491 | void |
451 | void |
492 | init_archetype_pointers () |
452 | archetype::postpone_arch_ref (arch_ptr &ref, const_utf8_string other_arch) |
493 | { |
453 | { |
494 | ring_arch = archetype::find ("ring"); |
454 | ref = 0; |
495 | amulet_arch = archetype::find ("amulet"); |
455 | postponed_arch_ref.push_back (std::pair<arch_ptr *, shstr>(&ref, shstr (other_arch))); |
496 | staff_arch = archetype::find ("staff"); |
|
|
497 | crown_arch = archetype::find ("crown"); |
|
|
498 | empty_archetype = archetype::find ("empty_archetype"); |
|
|
499 | } |
456 | } |
500 | |
457 | |
501 | /* |
458 | void |
502 | * Creates and returns a new object which is a copy of the given archetype. |
459 | archetype::commit_load () |
503 | * This function returns NULL on failure. |
|
|
504 | */ |
|
|
505 | object * |
|
|
506 | arch_to_object (archetype *at) |
|
|
507 | { |
460 | { |
|
|
461 | // unlink old archetypes and link in new ones */ |
|
|
462 | for (auto (p, postponed_arch.begin ()); p != postponed_arch.end (); ++p) |
|
|
463 | { |
|
|
464 | archetype *at = *p; |
|
|
465 | |
|
|
466 | if (archetype *old = find (at->archname)) |
|
|
467 | old->unlink (); |
|
|
468 | |
|
|
469 | allarch.push_back (at); |
|
|
470 | |
|
|
471 | at->link (); |
|
|
472 | ++dirtycnt; |
|
|
473 | } |
|
|
474 | |
|
|
475 | postponed_arch.clear (); |
|
|
476 | |
|
|
477 | // now resolve arch references |
|
|
478 | for (auto (p, postponed_arch_ref.begin ()); p != postponed_arch_ref.end (); ++p) |
|
|
479 | { |
|
|
480 | arch_ptr *ap = p->first; |
|
|
481 | archetype *at = find (p->second); |
|
|
482 | |
508 | if (!at) |
483 | if (!at) |
|
|
484 | LOG (llevError, "unable to resolve postponed arch reference to '%s'", &p->second); |
|
|
485 | |
|
|
486 | *ap = at; |
509 | { |
487 | } |
510 | LOG (llevError, "Couldn't find archetype.\n"); |
488 | |
|
|
489 | postponed_arch_ref.clear (); |
|
|
490 | |
|
|
491 | empty = find (shstr_empty_archetype); |
|
|
492 | } |
|
|
493 | |
|
|
494 | void |
|
|
495 | archetype::gc () |
|
|
496 | { |
|
|
497 | int cnt = max (1, min (allarch.size () / 128, dirtycnt)); |
|
|
498 | dirtycnt = max (0, dirtycnt - cnt); |
|
|
499 | |
|
|
500 | do |
|
|
501 | { |
|
|
502 | static int idx; |
|
|
503 | |
|
|
504 | if (idx >= allarch.size ()) |
|
|
505 | if (idx) |
|
|
506 | idx = 0; |
|
|
507 | else |
511 | return 0; |
508 | return; |
512 | } |
|
|
513 | |
509 | |
|
|
510 | archetype *at = allarch [idx]; |
|
|
511 | |
|
|
512 | if (at->refcnt_cnt () > 1) // all arches have ONE refcount from their object |
|
|
513 | ++idx; |
|
|
514 | else |
|
|
515 | { |
|
|
516 | LOG (llevDebug, "garbage collect arch %s", &at->archname); |
|
|
517 | assert (at->arch == at); // verify that refcnt == 1 is truly valid |
|
|
518 | allarch.erase (idx); |
|
|
519 | |
|
|
520 | // break chain |
|
|
521 | for (object *op = at->head_ (); op; ) |
|
|
522 | { |
|
|
523 | object *next = op->more; |
|
|
524 | op->head = 0; |
|
|
525 | op->more = 0; |
|
|
526 | op = next; |
|
|
527 | } |
|
|
528 | |
|
|
529 | at->destroy (); |
|
|
530 | at->arch = 0; |
|
|
531 | } |
|
|
532 | } |
|
|
533 | while (--cnt); |
|
|
534 | } |
|
|
535 | |
|
|
536 | object * |
|
|
537 | archetype::instance () |
|
|
538 | { |
514 | object *op = at->clone (); |
539 | object *op = clone (); |
515 | op->arch = at; |
|
|
516 | op->instantiate (); |
540 | op->instantiate (); |
517 | |
|
|
518 | return op; |
541 | return op; |
519 | } |
542 | } |
520 | |
543 | |
521 | /* |
544 | /* |
522 | * Creates an object. This function is called by get_archetype() |
545 | * Creates an object. This function is called by get_archetype() |
… | |
… | |
530 | LOG (llevError | logBacktrace, "FATAL: creating singularity for '%s'.\n", name); |
553 | LOG (llevError | logBacktrace, "FATAL: creating singularity for '%s'.\n", name); |
531 | |
554 | |
532 | if (!strcmp (name, "bug")) |
555 | if (!strcmp (name, "bug")) |
533 | abort (); |
556 | abort (); |
534 | |
557 | |
535 | char buf[MAX_BUF]; |
|
|
536 | sprintf (buf, "bug, please report (%s)", name); |
|
|
537 | |
|
|
538 | object *op = get_archetype ("bug"); |
558 | object *op = archetype::get (shstr_bug); |
539 | op->name = op->name_pl = buf; |
559 | op->name = op->name_pl = format ("bug, please report (missing archetype %s)", name); |
540 | |
560 | |
541 | return op; |
561 | return op; |
542 | } |
562 | } |
543 | |
563 | |
544 | /* |
564 | /* |
… | |
… | |
546 | * object containing a copy of the archetype. |
566 | * object containing a copy of the archetype. |
547 | */ |
567 | */ |
548 | object * |
568 | object * |
549 | get_archetype (const char *name) |
569 | get_archetype (const char *name) |
550 | { |
570 | { |
|
|
571 | return archetype::get (name); |
|
|
572 | } |
|
|
573 | |
|
|
574 | object * |
|
|
575 | archetype::get (const char *name) |
|
|
576 | { |
551 | archetype *at = archetype::find (name); |
577 | archetype *at = find (name); |
552 | |
578 | |
553 | if (!at) |
579 | if (!at) |
554 | return create_singularity (name); |
580 | return create_singularity (name); |
555 | |
581 | |
556 | return arch_to_object (at); |
582 | return at->instance (); |
557 | } |
583 | } |
558 | |
584 | |
559 | /* |
585 | /* |
560 | * Returns the first archetype using the given type. |
586 | * Returns the first archetype using the given type. |
561 | * Used in treasure-generation. |
587 | * Used in treasure-generation. |
… | |
… | |
576 | * Used in treasure-generation. |
602 | * Used in treasure-generation. |
577 | */ |
603 | */ |
578 | object * |
604 | object * |
579 | clone_arch (int type) |
605 | clone_arch (int type) |
580 | { |
606 | { |
581 | archetype *at; |
607 | archetype *at = type_to_archetype (type); |
582 | |
608 | |
583 | if ((at = type_to_archetype (type)) == NULL) |
609 | if (!at) |
584 | { |
610 | { |
585 | LOG (llevError, "Can't clone archetype %d\n", type); |
611 | LOG (llevError, "Can't clone archetype %d\n", type); |
586 | return 0; |
612 | return 0; |
587 | } |
613 | } |
588 | |
614 | |
589 | object *op = at->clone (); |
615 | return at->instance (); |
590 | op->instantiate (); |
|
|
591 | return op; |
|
|
592 | } |
616 | } |
593 | |
617 | |
594 | /* |
618 | /* |
595 | * member: make instance from class |
619 | * member: make instance from class |
596 | */ |
620 | */ |
… | |
… | |
599 | { |
623 | { |
600 | object *op, *prev = 0, *head = 0; |
624 | object *op, *prev = 0, *head = 0; |
601 | |
625 | |
602 | while (at) |
626 | while (at) |
603 | { |
627 | { |
604 | op = arch_to_object (at); |
628 | op = at->instance (); |
605 | |
629 | |
606 | op->x = at->x; |
630 | op->x = at->x; |
607 | op->y = at->y; |
631 | op->y = at->y; |
608 | |
632 | |
609 | if (head) |
633 | if (head) |