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

Comparing deliantra/server/server/time.C (file contents):
Revision 1.35 by root, Tue Jan 9 01:28:32 2007 UTC vs.
Revision 1.38 by root, Tue Feb 13 21:28:11 2007 UTC

245 return; 245 return;
246 } 246 }
247 247
248 if (op->stats.food == 1) 248 if (op->stats.food == 1)
249 { 249 {
250 /* need to remove the object before fix_player is called, else fix_player 250 /* need to unapply the object before update_stats is called, else fix_player
251 * will not do anything. 251 * will not do anything.
252 */ 252 */
253 if (op->env->type == PLAYER) 253 if (op->env->type == PLAYER)
254 { 254 {
255 CLEAR_FLAG (op, FLAG_APPLIED); 255 CLEAR_FLAG (op, FLAG_APPLIED);
455 455
456 if (op->stats.hp) 456 if (op->stats.hp)
457 { 457 {
458 for (tmp2 = tmp->inv; tmp2; tmp2 = tmp2->below) 458 for (tmp2 = tmp->inv; tmp2; tmp2 = tmp2->below)
459 { 459 {
460 if (op->slaying && !strcmp (op->slaying, tmp->name)) 460 if (op->slaying && op->slaying == tmp->name)
461 detected = 1; 461 detected = 1;
462
462 if (tmp2->type == FORCE && tmp2->slaying && !strcmp (tmp2->slaying, op->slaying)) 463 if (tmp2->type == FORCE && tmp2->slaying && tmp2->slaying == op->slaying)
463 detected = 1; 464 detected = 1;
464 } 465 }
465 } 466 }
467
466 if (op->slaying && !strcmp (op->slaying, tmp->name)) 468 if (op->slaying && op->slaying == tmp->name)
467 {
468 detected = 1; 469 detected = 1;
469 }
470 else if (tmp->type == SPECIAL_KEY && tmp->slaying == op->slaying) 470 else if (tmp->type == SPECIAL_KEY && tmp->slaying == op->slaying)
471 detected = 1; 471 detected = 1;
472 } 472 }
473 473
474 /* the detector sets the button if detection is found */ 474 /* the detector sets the button if detection is found */
1204 return; 1204 return;
1205 } 1205 }
1206 1206
1207 if (op->above == NULL) 1207 if (op->above == NULL)
1208 return; 1208 return;
1209
1209 for (tmp = op->above; tmp != NULL; tmp = tmp->above) 1210 for (tmp = op->above; tmp; tmp = tmp->above)
1210 { 1211 {
1211 if (strcmp (op->other_arch->name, tmp->arch->name) == 0) 1212 if (op->other_arch->name == tmp->arch->name)
1212 { 1213 {
1213 if (op->level <= 0) 1214 if (op->level <= 0)
1214 tmp->destroy (); 1215 tmp->destroy ();
1215 else 1216 else
1216 { 1217 {
1307 with a specific code as the slaying field. 1308 with a specific code as the slaying field.
1308 At that time, it writes the contents of its own message 1309 At that time, it writes the contents of its own message
1309 field to the player. The marker will decrement hp to 1310 field to the player. The marker will decrement hp to
1310 0 and then delete itself every time it grants a mark. 1311 0 and then delete itself every time it grants a mark.
1311 unless hp was zero to start with, in which case it is infinite.*/ 1312 unless hp was zero to start with, in which case it is infinite.*/
1312
1313void 1313void
1314move_marker (object *op) 1314move_marker (object *op)
1315{ 1315{
1316 if (object *tmp = op->ms ().player ()) 1316 if (object *tmp = op->ms ().player ())
1317 { 1317 {
1318 object *tmp2; 1318 object *tmp2;
1319 1319
1320 /* remove an old force with a slaying field == op->name */ 1320 /* remove an old force with a slaying field == op->name */
1321 for (tmp2 = tmp->inv; tmp2; tmp2 = tmp2->below) 1321 for (tmp2 = tmp->inv; tmp2; tmp2 = tmp2->below)
1322 if (tmp2->type == FORCE && tmp2->slaying && !strcmp (tmp2->slaying, op->name)) 1322 if (tmp2->type == FORCE && tmp2->slaying && tmp2->slaying == op->name)
1323 { 1323 {
1324 tmp2->destroy (); 1324 tmp2->destroy ();
1325 break; 1325 break;
1326 } 1326 }
1327 1327
1328 /* cycle through his inventory to look for the MARK we want to 1328 /* cycle through his inventory to look for the MARK we want to
1329 * place 1329 * place
1330 */ 1330 */
1331 for (tmp2 = tmp->inv; tmp2; tmp2 = tmp2->below) 1331 for (tmp2 = tmp->inv; tmp2; tmp2 = tmp2->below)
1332 if (tmp2->type == FORCE && tmp2->slaying && !strcmp (tmp2->slaying, op->slaying)) 1332 if (tmp2->type == FORCE && tmp2->slaying && tmp2->slaying == op->slaying)
1333 break; 1333 break;
1334 1334
1335 /* if we didn't find our own MARK */ 1335 /* if we didn't find our own MARK */
1336 if (tmp2 == NULL) 1336 if (!tmp2)
1337 { 1337 {
1338 object *force = get_archetype (FORCE_NAME); 1338 object *force = get_archetype (FORCE_NAME);
1339 1339
1340 if (op->stats.food) 1340 if (op->stats.food)
1341 { 1341 {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines