xbows: Invalid float vector #1251

Closed
opened 2021-12-31 02:54:20 +00:00 by AliasAlreadyTaken · 3 comments

2021-12-31 03:52:08: ACTION[Main]: Server: Shutting down
2021-12-31 03:52:38: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod 'x_bows' in callback item_OnUse(): Invalid float vector dimension range 'x' (expected -2.14748e+06 < x < 2.14748e+06 got -3.39367e+08).
2021-12-31 03:52:38: ERROR[Main]: stack traceback:
2021-12-31 03:52:38: ERROR[Main]: [C]: in function 'set_velocity'
2021-12-31 03:52:38: ERROR[Main]: /home/mtlive1/.minetest/mods/x_bows/init.lua:318: in function </home/mtlive1/.minetest/mods/x_bows/init.lua:250>

2021-12-31 03:52:08: ACTION[Main]: Server: Shutting down 2021-12-31 03:52:38: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod 'x_bows' in callback item_OnUse(): Invalid float vector dimension range 'x' (expected -2.14748e+06 < x < 2.14748e+06 got -3.39367e+08). 2021-12-31 03:52:38: ERROR[Main]: stack traceback: 2021-12-31 03:52:38: ERROR[Main]: [C]: in function 'set_velocity' 2021-12-31 03:52:38: ERROR[Main]: /home/mtlive1/.minetest/mods/x_bows/init.lua:318: in function </home/mtlive1/.minetest/mods/x_bows/init.lua:250>
AliasAlreadyTaken added the
2. prio/critical
1. kind/bug
labels 2021-12-31 03:02:34 +00:00
Author
Owner

Repro:

1. Start server, run it for 10 minutes.
2. Load bow
3. Restart server, run it for less than 10 minutes
4. Shoot bow
> Crash

Why?

https://gitea.your-land.de/your-land/x_bows/src/branch/yl_stable/init.lua#L251

* `minetest.get_us_time()`
    * returns time with microsecond precision. May not return wall time.

Which means, get_us_time() starts counting at server start. It is NOT meant to be serialized and NO indication of when the bow was charged.

Repro: ``` 1. Start server, run it for 10 minutes. 2. Load bow 3. Restart server, run it for less than 10 minutes 4. Shoot bow > Crash ``` Why? https://gitea.your-land.de/your-land/x_bows/src/branch/yl_stable/init.lua#L251 ``` * `minetest.get_us_time()` * returns time with microsecond precision. May not return wall time. ``` Which means, get_us_time() starts counting at server start. It is NOT meant to be serialized and NO indication of when the bow was charged.
Author
Owner

Fixed in 873b3ac856a5debc6c18f49d6ac978d58d8439e2

Fixed in 873b3ac856a5debc6c18f49d6ac978d58d8439e2
AliasAlreadyTaken added the
5. result/fixed
label 2022-01-01 08:29:18 +00:00
Author
Owner

Required further attention, we can't use get_us_time to save when the shot happened. And we need to make it that the bow gets unloaded, as soon as the player doesn't hold it in their hand or the server terminates or the bow is moved to a different inventory

Required further attention, we can't use get_us_time to save when the shot happened. And we need to make it that the bow gets unloaded, as soon as the player doesn't hold it in their hand or the server terminates or the bow is moved to a different inventory
AliasAlreadyTaken added this to the 1.1.104.3 milestone 2022-01-04 10:03:46 +00:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: your-land/bugtracker#1251
No description provided.