ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/server/plugins.c
(Generate patch)

Comparing deliantra/server/server/plugins.c (file contents):
Revision 1.3 by root, Wed Feb 8 03:46:15 2006 UTC vs.
Revision 1.13 by elmex, Sat Aug 12 11:51:38 2006 UTC

1/* 1/*
2 * static char *rcsid_plugins_c = 2 * static char *rcsid_plugins_c =
3 * "$Id: plugins.c,v 1.3 2006/02/08 03:46:15 root Exp $"; 3 * "$Id: plugins.c,v 1.13 2006/08/12 11:51:38 elmex Exp $";
4 */ 4 */
5 5
6/*****************************************************************************/ 6/*****************************************************************************/
7/* CrossFire, A Multiplayer game for X-windows */ 7/* CrossFire, A Multiplayer game for X-windows */
8/* */ 8/* */
127 127
128/*****************************************************************************/ 128/*****************************************************************************/
129/* NEW PLUGIN STUFF STARTS HERE */ 129/* NEW PLUGIN STUFF STARTS HERE */
130/*****************************************************************************/ 130/*****************************************************************************/
131 131
132static void plugin_load_original_map(mapstruct *map)
133{
134 execute_global_event (EVENT_MAPLOAD, map);
135}
136
137static void plugin_load_temporary_map(mapstruct *map)
138{
139 execute_global_event (EVENT_MAPIN, map);
140}
141
142static void plugin_clean_temporary_map(mapstruct *map)
143{
144 execute_global_event (EVENT_MAPCLEAN, map);
145}
146
132static void plugin_object_free(object *ob) 147static void plugin_object_free(object *ob)
133{ 148{
134 execute_global_event (EVENT_FREE_OB, ob); 149 execute_global_event (EVENT_FREE_OB, ob);
135} 150}
136 151
217 crossfire_plugin* plugin; 232 crossfire_plugin* plugin;
218 int rv = 0; 233 int rv = 0;
219 for (tmp = op->inv; tmp != NULL; tmp = next) { 234 for (tmp = op->inv; tmp != NULL; tmp = next) {
220 next = tmp->below; 235 next = tmp->below;
221 if (tmp->type == EVENT_CONNECTOR && tmp->subtype == eventcode) { 236 if (tmp->type == EVENT_CONNECTOR && tmp->subtype == eventcode) {
237#if 0
222 LOG(llevDebug, "********** EVENT HANDLER **********\n"); 238 LOG(llevDebug, "********** EVENT HANDLER **********\n");
223 LOG(llevDebug, " - Who am I :%s\n", op->name); 239 LOG(llevDebug, " - Who am I :%s\n", op->name);
224 if (activator != NULL) 240 if (activator != NULL)
225 LOG(llevDebug, " - Activator :%s\n", activator->name); 241 LOG(llevDebug, " - Activator :%s\n", activator->name);
226 if (third != NULL) 242 if (third != NULL)
230 LOG(llevDebug, " - Event plugin :%s\n", tmp->title); 246 LOG(llevDebug, " - Event plugin :%s\n", tmp->title);
231 if (tmp->slaying != NULL) 247 if (tmp->slaying != NULL)
232 LOG(llevDebug, " - Event hook :%s\n", tmp->slaying); 248 LOG(llevDebug, " - Event hook :%s\n", tmp->slaying);
233 if (tmp->name != NULL) 249 if (tmp->name != NULL)
234 LOG(llevDebug, " - Event options :%s\n", tmp->name); 250 LOG(llevDebug, " - Event options :%s\n", tmp->name);
251#endif
235 252
236 if (tmp->title == NULL) { 253 if (tmp->title == NULL) {
237 object *env = object_get_env_recursive(tmp); 254 object *env = object_get_env_recursive(tmp);
238 LOG(llevError, "Event object without title at %d/%d in map %s\n", env->x, env->y, env->map->name); 255 LOG(llevError, "Event object without title at %d/%d in map %s\n", env->x, env->y, env->map->name);
239 send_removed_object(tmp); 256 send_removed_object(tmp);
255 free_object(tmp); 272 free_object(tmp);
256 } else { 273 } else {
257 int rvt = 0; 274 int rvt = 0;
258 int *rv; 275 int *rv;
259 276
260 rv = plugin->eventfunc(&rvt, op, eventcode, activator, third, message, fix, tmp->slaying, tmp->name); 277 rv = plugin->eventfunc(&rvt, op, eventcode, activator, third, message, fix, tmp->slaying, tmp->name, tmp);
261 return *rv; 278 return *rv;
262 } 279 }
263 } 280 }
264 } 281 }
265 } 282 }
269int execute_global_event(int eventcode, ...) 286int execute_global_event(int eventcode, ...)
270{ 287{
271 va_list args; 288 va_list args;
272 object* op; 289 object* op;
273 object* op2; 290 object* op2;
291 object* op3;
292 mapstruct *map;
274 player* pl; 293 player* pl;
275 char* buf; 294 char* buf;
276 int i, rt; 295 int i, rt, retval = 0, *tmpretval = NULL, fix;
277 crossfire_plugin* cp; 296 crossfire_plugin* cp;
278 if (plugins_list == NULL) 297 if (plugins_list == NULL)
279 return -1; 298 return -1;
280 299
281 va_start(args, eventcode); 300 va_start(args, eventcode);
287 case EVENT_TELL: 306 case EVENT_TELL:
288 /* no additional arguments */ 307 /* no additional arguments */
289 for (cp = plugins_list; cp != NULL; cp = cp->next) { 308 for (cp = plugins_list; cp != NULL; cp = cp->next) {
290 if (cp->gevent[eventcode] != NULL) 309 if (cp->gevent[eventcode] != NULL)
291 cp->gevent[eventcode](&rt, eventcode); 310 cp->gevent[eventcode](&rt, eventcode);
311 }
312 break;
313
314 case EVENT_PLAYER_LOAD:
315 case EVENT_PLAYER_SAVE:
316 /* object, filename */
317 op = va_arg(args, object*);
318 buf = va_arg(args, char*);
319 for (cp = plugins_list; cp != NULL; cp = cp->next) {
320 if (cp->gevent[eventcode] != NULL)
321 cp->gevent[eventcode](&rt, eventcode, op, buf);
322 }
323 break;
324
325 case EVENT_MAPLOAD:
326 case EVENT_MAPOUT:
327 case EVENT_MAPIN:
328 case EVENT_MAPCLEAN:
329 /* map argument */
330 map = va_arg(args, mapstruct*);
331 for (cp = plugins_list; cp != NULL; cp = cp->next) {
332 if (cp->gevent[eventcode] != NULL)
333 cp->gevent[eventcode](&rt, eventcode, map);
292 } 334 }
293 break; 335 break;
294 336
295 case EVENT_REMOVE: 337 case EVENT_REMOVE:
296 case EVENT_MAPENTER: 338 case EVENT_MAPENTER:
373 for (cp = plugins_list; cp != NULL; cp = cp->next) { 415 for (cp = plugins_list; cp != NULL; cp = cp->next) {
374 if (cp->gevent[eventcode] != NULL) 416 if (cp->gevent[eventcode] != NULL)
375 cp->gevent[eventcode](&rt, eventcode, op, buf); 417 cp->gevent[eventcode](&rt, eventcode, op, buf);
376 } 418 }
377 break; 419 break;
420
421 case EVENT_FIND_UNARMED_SKILL:
422 op = va_arg(args, object*);
423 for (cp = plugins_list; cp != NULL; cp = cp->next) {
424 if (cp->gevent[eventcode] != NULL)
425 if ((tmpretval = cp->gevent[eventcode](&rt, eventcode, op)) && *tmpretval > 0) {
426 retval = *tmpretval;
427 }
428 }
429 break;
430
431 case EVENT_PLAYER_USE_SKILL:
432 case EVENT_MONSTER_USE_SKILL:
433 op = va_arg(args, object*);
434 op2 = va_arg(args, object*);
435 op3 = va_arg(args, object*);
436 fix = va_arg(args, int);
437 buf = va_arg(args, char*);
438 for (cp = plugins_list; cp != NULL; cp = cp->next) {
439 if (cp->gevent[eventcode] != NULL)
440 if ((tmpretval = cp->gevent[eventcode](&rt, eventcode, op, op2, op3, fix, buf)) && *tmpretval != 0) {
441 retval = *tmpretval;
442 }
443 }
444 break;
445
446 case EVENT_CAST_SPELL:
447 op = va_arg(args, object*);
448 op2 = va_arg(args, object*);
449 op3 = va_arg(args, object*);
450 fix = va_arg(args, int);
451 buf = va_arg(args, char*);
452 for (cp = plugins_list; cp != NULL; cp = cp->next) {
453 if (cp->gevent[eventcode] != NULL)
454 if ((tmpretval = cp->gevent[eventcode](&rt, eventcode, op, op2, op3, fix, buf)) && *tmpretval != 0) {
455 retval = *tmpretval;
456 break; /* The first who did something wins! */
457 }
458 }
459 break;
460
461 case EVENT_EXTCMD:
462 /*KICK: op, parms*/
463 pl = va_arg (args, player *);
464 buf = va_arg (args, char *);
465 i = va_arg (args, int);
466 for (cp = plugins_list; cp != NULL; cp = cp->next) {
467 if (cp->gevent[eventcode] != NULL)
468 cp->gevent[eventcode](&rt, eventcode, pl, buf, i, buf);
469 }
470 break;
378 } 471 }
379 va_end(args); 472 va_end(args);
473
380 return 0; 474 return retval;
381} 475}
382 476
383int plugins_init_plugin(const char* libfile) 477int plugins_init_plugin(const char* libfile)
384{ 478{
385 LIBPTRTYPE ptr; 479 LIBPTRTYPE ptr;
390 f_plug_postinit closefunc; 484 f_plug_postinit closefunc;
391 int i; 485 int i;
392 crossfire_plugin* cp; 486 crossfire_plugin* cp;
393 crossfire_plugin* ccp; 487 crossfire_plugin* ccp;
394 488
489 load_original_map_callback = plugin_load_original_map;
490 load_temporary_map_callback = plugin_load_temporary_map;
491 clean_temporary_map_callback = plugin_clean_temporary_map;
395 object_free_callback = plugin_object_free; 492 object_free_callback = plugin_object_free;
396 493
397 /* Open the plugin lib and load the required functions */ 494 /* Open the plugin lib and load the required functions */
398 ptr = plugins_dlopen(libfile); 495 ptr = plugins_dlopen(libfile);
399 if (ptr == NULL) { 496 if (ptr == NULL) {
1362 rv = op->map; 1459 rv = op->map;
1363 *type = CFAPI_PMAP; 1460 *type = CFAPI_PMAP;
1364 break; 1461 break;
1365 1462
1366 case CFAPI_OBJECT_PROP_COUNT: 1463 case CFAPI_OBJECT_PROP_COUNT:
1367 rv = &op->count; 1464 ri = op->count; rv = &ri;
1368 *type = CFAPI_INT; 1465 *type = CFAPI_INT;
1369 break; 1466 break;
1370 1467
1371 case CFAPI_OBJECT_PROP_REFCOUNT: 1468 case CFAPI_OBJECT_PROP_REFCOUNT:
1372 rv = &op->refcount; 1469 ri = op->refcount; rv = &ri;
1373 *type = CFAPI_INT; 1470 *type = CFAPI_INT;
1374 break; 1471 break;
1375 1472
1376 case CFAPI_OBJECT_PROP_NAME: 1473 case CFAPI_OBJECT_PROP_NAME:
1377 rv = query_name(op); 1474 rv = query_name(op);
1436 rv = &op->speed_left; 1533 rv = &op->speed_left;
1437 *type = CFAPI_DOUBLE; 1534 *type = CFAPI_DOUBLE;
1438 break; 1535 break;
1439 1536
1440 case CFAPI_OBJECT_PROP_NROF: 1537 case CFAPI_OBJECT_PROP_NROF:
1441 rv = &op->nrof; 1538 ri = op->nrof; rv = &ri;
1442 *type = CFAPI_INT; 1539 *type = CFAPI_INT;
1443 break; 1540 break;
1444 1541
1445 case CFAPI_OBJECT_PROP_DIRECTION: 1542 case CFAPI_OBJECT_PROP_DIRECTION:
1446 rv = &op->direction; 1543 ri = op->direction; rv = &ri;
1447 *type = CFAPI_INT; 1544 *type = CFAPI_INT;
1448 break; 1545 break;
1449 1546
1450 case CFAPI_OBJECT_PROP_FACING: 1547 case CFAPI_OBJECT_PROP_FACING:
1451 rv = &op->facing; 1548 ri = op->facing; rv = &ri;
1452 *type = CFAPI_INT; 1549 *type = CFAPI_INT;
1453 break; 1550 break;
1454 1551
1455 case CFAPI_OBJECT_PROP_TYPE: 1552 case CFAPI_OBJECT_PROP_TYPE:
1456 rv = &op->type; 1553 ri = op->type; rv = &ri;
1457 *type = CFAPI_INT; 1554 *type = CFAPI_INT;
1458 break; 1555 break;
1459 1556
1460 case CFAPI_OBJECT_PROP_SUBTYPE: 1557 case CFAPI_OBJECT_PROP_SUBTYPE:
1461 rv = &op->subtype; 1558 ri = op->subtype; rv = &ri;
1462 *type = CFAPI_INT; 1559 *type = CFAPI_INT;
1463 break; 1560 break;
1464 1561
1465 case CFAPI_OBJECT_PROP_CLIENT_TYPE: 1562 case CFAPI_OBJECT_PROP_CLIENT_TYPE:
1466 rv = &op->client_type; 1563 ri = op->client_type; rv = &ri;
1467 *type = CFAPI_INT; 1564 *type = CFAPI_INT;
1468 break; 1565 break;
1469 1566
1470 case CFAPI_OBJECT_PROP_RESIST: 1567 case CFAPI_OBJECT_PROP_RESIST:
1471 { 1568 {
1472 int idx; 1569 int idx;
1473 idx = va_arg(args, int); 1570 idx = va_arg(args, int);
1474 rv = &op->resist[idx]; 1571 ri = op->resist[idx]; rv = &ri;
1475 } 1572 }
1476 *type = CFAPI_INT; 1573 *type = CFAPI_INT;
1477 break; 1574 break;
1478 1575
1479 case CFAPI_OBJECT_PROP_ATTACK_TYPE: 1576 case CFAPI_OBJECT_PROP_ATTACK_TYPE:
1480 rv = &op->attacktype; 1577 ri = op->attacktype; rv = &ri;
1481 *type = CFAPI_INT; 1578 *type = CFAPI_INT;
1482 break; 1579 break;
1483 1580
1484 case CFAPI_OBJECT_PROP_PATH_ATTUNED: 1581 case CFAPI_OBJECT_PROP_PATH_ATTUNED:
1485 rv = &op->path_attuned; 1582 ri = op->path_attuned; rv = &ri;
1486 *type = CFAPI_INT; 1583 *type = CFAPI_INT;
1487 break; 1584 break;
1488 1585
1489 case CFAPI_OBJECT_PROP_PATH_REPELLED: 1586 case CFAPI_OBJECT_PROP_PATH_REPELLED:
1490 rv = &op->path_repelled; 1587 ri = op->path_repelled; rv = &ri;
1491 *type = CFAPI_INT; 1588 *type = CFAPI_INT;
1492 break; 1589 break;
1493 1590
1494 case CFAPI_OBJECT_PROP_PATH_DENIED: 1591 case CFAPI_OBJECT_PROP_PATH_DENIED:
1495 rv = &op->path_denied; 1592 ri = op->path_denied; rv = &ri;
1496 *type = CFAPI_INT; 1593 *type = CFAPI_INT;
1497 break; 1594 break;
1498 1595
1499 case CFAPI_OBJECT_PROP_MATERIAL: 1596 case CFAPI_OBJECT_PROP_MATERIAL:
1500 rv = &op->material; 1597 ri = op->material; rv = &ri;
1501 *type = CFAPI_INT; 1598 *type = CFAPI_INT;
1502 break; 1599 break;
1503 1600
1504 case CFAPI_OBJECT_PROP_MATERIAL_NAME: 1601 case CFAPI_OBJECT_PROP_MATERIAL_NAME:
1505 rv = (char*)op->materialname; 1602 rv = (char*)op->materialname;
1506 *type = CFAPI_STRING; 1603 *type = CFAPI_STRING;
1507 break; 1604 break;
1508 1605
1509 case CFAPI_OBJECT_PROP_MAGIC: 1606 case CFAPI_OBJECT_PROP_MAGIC:
1510 rv = &op->magic; 1607 ri = op->magic; rv = &ri;
1511 *type = CFAPI_INT; 1608 *type = CFAPI_INT;
1512 break; 1609 break;
1513 1610
1514 case CFAPI_OBJECT_PROP_VALUE: 1611 case CFAPI_OBJECT_PROP_VALUE:
1515 rv = &op->value; 1612 ri = op->value; rv = &ri;
1516 *type = CFAPI_INT; 1613 *type = CFAPI_INT;
1517 break; 1614 break;
1518 1615
1519 case CFAPI_OBJECT_PROP_LEVEL: 1616 case CFAPI_OBJECT_PROP_LEVEL:
1520 rv = &op->level; 1617 ri = op->level; rv = &ri;
1521 *type = CFAPI_INT; 1618 *type = CFAPI_INT;
1522 break; 1619 break;
1523 1620
1524 case CFAPI_OBJECT_PROP_LAST_HEAL: 1621 case CFAPI_OBJECT_PROP_LAST_HEAL:
1525 rv = &op->last_heal; 1622 ri = op->last_heal; rv = &ri;
1526 *type = CFAPI_INT; 1623 *type = CFAPI_INT;
1527 break; 1624 break;
1528 1625
1529 case CFAPI_OBJECT_PROP_LAST_SP: 1626 case CFAPI_OBJECT_PROP_LAST_SP:
1530 rv = &op->last_sp; 1627 ri = op->last_sp; rv = &ri;
1531 *type = CFAPI_INT; 1628 *type = CFAPI_INT;
1532 break; 1629 break;
1533 1630
1534 case CFAPI_OBJECT_PROP_LAST_GRACE: 1631 case CFAPI_OBJECT_PROP_LAST_GRACE:
1535 rv = &op->last_grace; 1632 ri = op->last_grace; rv = &ri;
1536 *type = CFAPI_INT; 1633 *type = CFAPI_INT;
1537 break; 1634 break;
1538 1635
1539 case CFAPI_OBJECT_PROP_LAST_EAT: 1636 case CFAPI_OBJECT_PROP_LAST_EAT:
1540 rv = &op->last_eat; 1637 ri = op->last_eat; rv = &ri;
1541 *type = CFAPI_INT; 1638 *type = CFAPI_INT;
1542 break; 1639 break;
1543 1640
1544 case CFAPI_OBJECT_PROP_INVISIBLE_TIME: 1641 case CFAPI_OBJECT_PROP_INVISIBLE_TIME:
1545 rv = &op->invisible; 1642 ri = op->invisible; rv = &ri;
1546 *type = CFAPI_INT; 1643 *type = CFAPI_INT;
1547 break; 1644 break;
1548 1645
1549 case CFAPI_OBJECT_PROP_PICK_UP: 1646 case CFAPI_OBJECT_PROP_PICK_UP:
1550 rv = &op->pick_up; 1647 ri = op->pick_up; rv = &ri;
1551 *type = CFAPI_INT; 1648 *type = CFAPI_INT;
1552 break; 1649 break;
1553 1650
1554 case CFAPI_OBJECT_PROP_ITEM_POWER: 1651 case CFAPI_OBJECT_PROP_ITEM_POWER:
1555 rv = &op->item_power; 1652 ri = op->item_power; rv = &ri;
1556 *type = CFAPI_INT; 1653 *type = CFAPI_INT;
1557 break; 1654 break;
1558 1655
1559 case CFAPI_OBJECT_PROP_GEN_SP_ARMOUR: 1656 case CFAPI_OBJECT_PROP_GEN_SP_ARMOUR:
1560 rv = &op->gen_sp_armour; 1657 ri = op->gen_sp_armour; rv = &ri;
1561 *type = CFAPI_INT; 1658 *type = CFAPI_INT;
1562 break; 1659 break;
1563 1660
1564 case CFAPI_OBJECT_PROP_WEIGHT: 1661 case CFAPI_OBJECT_PROP_WEIGHT:
1565 rv = &op->weight; 1662 ri = op->weight; rv = &ri;
1566 *type = CFAPI_INT; 1663 *type = CFAPI_INT;
1567 break; 1664 break;
1568 1665
1569 case CFAPI_OBJECT_PROP_WEIGHT_LIMIT: 1666 case CFAPI_OBJECT_PROP_WEIGHT_LIMIT:
1570 rv = &op->weight_limit; 1667 ri = op->weight_limit; rv = &ri;
1571 *type = CFAPI_INT; 1668 *type = CFAPI_INT;
1572 break; 1669 break;
1573 1670
1574 case CFAPI_OBJECT_PROP_CARRYING: 1671 case CFAPI_OBJECT_PROP_CARRYING:
1575 rv = &op->carrying; 1672 ri = op->carrying; rv = &ri;
1576 *type = CFAPI_INT; 1673 *type = CFAPI_INT;
1577 break; 1674 break;
1578 1675
1579 case CFAPI_OBJECT_PROP_GLOW_RADIUS: 1676 case CFAPI_OBJECT_PROP_GLOW_RADIUS:
1580 rv = &op->glow_radius; 1677 ri = op->glow_radius; rv = &ri;
1581 *type = CFAPI_INT; 1678 *type = CFAPI_INT;
1582 break; 1679 break;
1583 1680
1584 case CFAPI_OBJECT_PROP_PERM_EXP: 1681 case CFAPI_OBJECT_PROP_PERM_EXP:
1585 rv = &op->perm_exp; 1682 rv = &op->perm_exp;
1600 rv = op->attacked_by; 1697 rv = op->attacked_by;
1601 *type = CFAPI_POBJECT; 1698 *type = CFAPI_POBJECT;
1602 break; 1699 break;
1603 1700
1604 case CFAPI_OBJECT_PROP_RUN_AWAY: 1701 case CFAPI_OBJECT_PROP_RUN_AWAY:
1605 rv = &op->run_away; 1702 ri = op->run_away; rv = &ri;
1606 *type = CFAPI_INT; 1703 *type = CFAPI_INT;
1607 break; 1704 break;
1608 1705
1609 case CFAPI_OBJECT_PROP_CHOSEN_SKILL: 1706 case CFAPI_OBJECT_PROP_CHOSEN_SKILL:
1610 rv = op->chosen_skill; 1707 rv = op->chosen_skill;
1611 *type = CFAPI_POBJECT; 1708 *type = CFAPI_POBJECT;
1612 break; 1709 break;
1613 1710
1614 case CFAPI_OBJECT_PROP_HIDDEN: 1711 case CFAPI_OBJECT_PROP_HIDDEN:
1615 rv = &op->hide; 1712 ri = op->hide; rv = &ri;
1616 *type = CFAPI_INT; 1713 *type = CFAPI_INT;
1617 break; 1714 break;
1618 1715
1619 case CFAPI_OBJECT_PROP_MOVE_STATUS: 1716 case CFAPI_OBJECT_PROP_MOVE_STATUS:
1620 rv = &op->move_status; 1717 ri = op->move_status; rv = &ri;
1621 *type = CFAPI_INT; 1718 *type = CFAPI_INT;
1622 break; 1719 break;
1623 1720
1624 case CFAPI_OBJECT_PROP_MOVE_TYPE: 1721 case CFAPI_OBJECT_PROP_MOVE_TYPE:
1625 rv = &op->attack_movement; 1722 ri = op->attack_movement; rv = &ri;
1626 *type = CFAPI_INT; 1723 *type = CFAPI_INT;
1627 break; 1724 break;
1628 1725
1629 case CFAPI_OBJECT_PROP_SPELL_ITEM: 1726 case CFAPI_OBJECT_PROP_SPELL_ITEM:
1630 rv = op->spellitem; 1727 rv = op->spellitem;
1650 rv = (char*)op->custom_name; 1747 rv = (char*)op->custom_name;
1651 *type = CFAPI_STRING; 1748 *type = CFAPI_STRING;
1652 break; 1749 break;
1653 1750
1654 case CFAPI_OBJECT_PROP_ANIM_SPEED: 1751 case CFAPI_OBJECT_PROP_ANIM_SPEED:
1655 rv = &op->anim_speed; 1752 ri = op->anim_speed; rv = &ri;
1656 *type = CFAPI_INT; 1753 *type = CFAPI_INT;
1657 break; 1754 break;
1658 1755
1659 case CFAPI_OBJECT_PROP_FRIENDLY: 1756 case CFAPI_OBJECT_PROP_FRIENDLY:
1660 ri = is_friendly(op); 1757 ri = is_friendly(op);
1681 rv = &ri; 1778 rv = &ri;
1682 *type = CFAPI_INT; 1779 *type = CFAPI_INT;
1683 break; 1780 break;
1684 1781
1685 case CFAPI_OBJECT_PROP_LUCK: 1782 case CFAPI_OBJECT_PROP_LUCK:
1686 rv = &op->stats.luck; 1783 ri = op->stats.luck; rv = &ri;
1687 *type = CFAPI_INT; 1784 *type = CFAPI_INT;
1688 break; 1785 break;
1689 1786
1690 case CFAPI_OBJECT_PROP_EXP: 1787 case CFAPI_OBJECT_PROP_EXP:
1691 rv = &op->stats.exp; 1788 rv = &op->stats.exp;
1728 *type = CFAPI_POBJECT; 1825 *type = CFAPI_POBJECT;
1729 break; 1826 break;
1730 1827
1731 case CFAPI_OBJECT_PROP_CHEATER: 1828 case CFAPI_OBJECT_PROP_CHEATER:
1732 ri = (QUERY_FLAG(op, FLAG_WAS_WIZ)); 1829 ri = (QUERY_FLAG(op, FLAG_WAS_WIZ));
1830 rv = &ri;
1733 *type = CFAPI_INT; 1831 *type = CFAPI_INT;
1734 break; 1832 break;
1735 1833
1736 case CFAPI_OBJECT_PROP_MERGEABLE: 1834 case CFAPI_OBJECT_PROP_MERGEABLE:
1737 { 1835 {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines