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

Comparing deliantra/server/common/button.C (file contents):
Revision 1.20 by root, Tue Dec 26 08:54:58 2006 UTC vs.
Revision 1.21 by root, Sat Dec 30 10:16:10 2006 UTC

273 update_object (op, UP_OBJ_FACE); 273 update_object (op, UP_OBJ_FACE);
274 push_button (op); /* Make all other buttons the same */ 274 push_button (op); /* Make all other buttons the same */
275 } 275 }
276} 276}
277 277
278/*
279 * Updates every button on the map (by calling update_button() for them).
280 */
281
282void
283update_buttons (maptile *m)
284{
285 objectlink *ol;
286 oblinkpt *obp;
287
288 for (obp = m->buttons; obp; obp = obp->next)
289 for (ol = obp->link; ol; ol = ol->next)
290 {
291 if (!ol->ob)
292 {
293 LOG (llevError, "Internal error in update_button (%s (%dx%d), connected %ld).\n",
294 ol->ob ? (const char *) ol->ob->name : "null", ol->ob ? ol->ob->x : -1, ol->ob ? ol->ob->y : -1, obp->value);
295 continue;
296 }
297
298 if (ol->ob->type == BUTTON || ol->ob->type == PEDESTAL)
299 {
300 update_button (ol->ob);
301 break;
302 }
303 }
304}
305
306void 278void
307use_trigger (object *op) 279use_trigger (object *op)
308{ 280{
309
310 /* Toggle value */ 281 /* Toggle value */
311 op->value = !op->value; 282 op->value = !op->value;
312 push_button (op); 283 push_button (op);
313} 284}
314 285
315/* 286/*
316 * Note: animate_object should be used instead of this, 287 * Note: animate_object should be used instead of this,
317 * but it can't handle animations in the 8 directions 288 * but it can't handle animations in the 8 directions
318 */ 289 */
319
320void 290void
321animate_turning (object *op) /* only one part objects */ 291animate_turning (object *op) /* only one part objects */
322{ 292{
323 if (++op->state >= NUM_ANIMATIONS (op) / 8) 293 if (++op->state >= NUM_ANIMATIONS (op) / 8)
324 op->state = 0; 294 op->state = 0;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines