| 493 | /* does object have a timer of certain type? */ |
| 494 | /* local hastimer = o:has_timer("rot-organic"); */ |
| 495 | staticfn int |
| 496 | l_obj_timer_has(lua_State *L) |
| 497 | { |
| 498 | int argc = lua_gettop(L); |
| 499 | |
| 500 | if (argc == 2) { |
| 501 | struct _lua_obj *lo = l_obj_check(L, 1); |
| 502 | short timertype = nhl_get_timertype(L, 2); |
| 503 | |
| 504 | if (timer_is_obj(timertype) && lo && lo->obj) { |
| 505 | lua_pushboolean(L, obj_has_timer(lo->obj, timertype)); |
| 506 | return 1; |
| 507 | } else { |
| 508 | lua_pushboolean(L, FALSE); |
| 509 | return 1; |
| 510 | } |
| 511 | } else |
| 512 | nhl_error(L, "l_obj_timer_has: Wrong args"); |
| 513 | return 0; |
| 514 | } |
| 515 | |
| 516 | /* peek at an object timer. return the turn when timer triggers. |
| 517 | returns 0 if no such timer attached to the object. */ |
nothing calls this directly
no test coverage detected