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.84 by root, Thu Jan 8 04:35:05 2009 UTC vs.
Revision 1.85 by elmex, Mon Jan 12 00:17:23 2009 UTC

857 op->remove (); 857 op->remove ();
858 for (i = 0; i < op->stats.food; i++) 858 for (i = 0; i < op->stats.food; i++)
859 { 859 {
860 object *tmp = arch_to_object (op->other_arch); 860 object *tmp = arch_to_object (op->other_arch);
861 861
862 if (op->type == LAMP)
863 tmp->stats.food = op->stats.food - 1;
864
865 tmp->stats.hp = op->stats.hp; /* The only variable it keeps. */ 862 tmp->stats.hp = op->stats.hp; /* The only variable it keeps. */
866 863
867 if (env) 864 if (env)
868 env->insert (tmp); 865 env->insert (tmp);
869 else 866 else
1269{ 1266{
1270 op->set_speed (0); 1267 op->set_speed (0);
1271 cfperl_mapscript_activate (op, true, op, 0); 1268 cfperl_mapscript_activate (op, true, op, 0);
1272} 1269}
1273 1270
1271void move_lamp (object *op)
1272{
1273 // if the lamp/torch is off, we should disable it.
1274 if (!op->glow_radius)
1275 {
1276 op->set_speed (0);
1277 return;
1278 }
1279
1280 // lamps and torches auf maps don't use up their fuel
1281 if (op->is_on_map ())
1282 return;
1283
1284 if (op->stats.food > 0)
1285 {
1286 op->stats.food--;
1287 return;
1288 }
1289
1290 apply_lamp (op, false);
1291}
1292
1274void 1293void
1275process_object (object *op) 1294process_object (object *op)
1276{ 1295{
1277 if (expect_false (QUERY_FLAG (op, FLAG_IS_A_TEMPLATE))) 1296 if (expect_false (QUERY_FLAG (op, FLAG_IS_A_TEMPLATE)))
1278 return; 1297 return;
1454 break; 1473 break;
1455 1474
1456 case MAPSCRIPT: 1475 case MAPSCRIPT:
1457 move_mapscript (op); 1476 move_mapscript (op);
1458 break; 1477 break;
1459 }
1460}
1461 1478
1479 case LAMP:
1480 case TORCH:
1481 move_lamp (op);
1482 break;
1483 }
1484}
1485

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines