when does location at x,y timer trigger? */ local melttime = nh.peek_timer_at(x,y, "melt-ice"); */ local melttime = nh.peek_timer_at({x=5,y=6}, "melt-ice"); */
| 1556 | /* local melttime = nh.peek_timer_at(x,y, "melt-ice"); */ |
| 1557 | /* local melttime = nh.peek_timer_at({x=5,y=6}, "melt-ice"); */ |
| 1558 | staticfn int |
| 1559 | nhl_timer_peek_at(lua_State *L) |
| 1560 | { |
| 1561 | long when = 0L; |
| 1562 | short timertype = nhl_get_timertype(L, -1); |
| 1563 | lua_Integer lx, ly; |
| 1564 | coordxy x, y; |
| 1565 | |
| 1566 | lua_pop(L, 1); /* remove timertype */ |
| 1567 | if (!nhl_get_xy_params(L, &lx, &ly)) { |
| 1568 | nhl_error(L, "nhl_timer_peek_at: Wrong args"); |
| 1569 | /*NOTREACHED*/ |
| 1570 | return 0; |
| 1571 | } |
| 1572 | |
| 1573 | x = (coordxy) lx; |
| 1574 | y = (coordxy) ly; |
| 1575 | cvt_to_abscoord(&x, &y); |
| 1576 | |
| 1577 | if (timer_is_pos(timertype) && isok(x, y)) |
| 1578 | when = spot_time_expires(x, y, timertype); |
| 1579 | lua_pushinteger(L, when); |
| 1580 | return 1; |
| 1581 | } |
| 1582 | |
| 1583 | /* stop timer at location x,y */ |
| 1584 | /* nh.stop_timer_at(x,y, "melt-ice"); */ |
nothing calls this directly
no test coverage detected