| 1525 | /* local has_melttimer = nh.has_timer_at(x,y, "melt-ice"); */ |
| 1526 | /* local has_melttimer = nh.has_timer_at({x=4,y=7}, "melt-ice"); */ |
| 1527 | staticfn int |
| 1528 | nhl_timer_has_at(lua_State *L) |
| 1529 | { |
| 1530 | boolean ret = FALSE; |
| 1531 | short timertype = nhl_get_timertype(L, -1); |
| 1532 | lua_Integer lx, ly; |
| 1533 | coordxy x, y; |
| 1534 | long when; |
| 1535 | |
| 1536 | lua_pop(L, 1); /* remove timertype */ |
| 1537 | if (!nhl_get_xy_params(L, &lx, &ly)) { |
| 1538 | nhl_error(L, "nhl_timer_has_at: Wrong args"); |
| 1539 | /*NOTREACHED*/ |
| 1540 | return 0; |
| 1541 | } |
| 1542 | |
| 1543 | x = (coordxy) lx; |
| 1544 | y = (coordxy) ly; |
| 1545 | cvt_to_abscoord(&x, &y); |
| 1546 | |
| 1547 | if (isok(x, y)) { |
| 1548 | when = spot_time_expires(x, y, timertype); |
| 1549 | ret = (when > 0L); |
| 1550 | } |
| 1551 | lua_pushboolean(L, ret); |
| 1552 | return 1; |
| 1553 | } |
| 1554 | |
| 1555 | /* when does location at x,y timer trigger? */ |
| 1556 | /* local melttime = nh.peek_timer_at(x,y, "melt-ice"); */ |
nothing calls this directly
no test coverage detected