mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 18:22:39 +00:00
https://github.com/tgstation/tgstation/pull/31092 - Fixes subsystems not returning a qdel hint https://github.com/tgstation/tgstation/pull/31494 - In which the stoner one gets stoned and tries to address tick contention... again https://github.com/tgstation/tgstation/pull/31950 - Removes an empty New() https://github.com/tgstation/tgstation/pull/31951 - Logs subsystem shutdowns
15 lines
979 B
Plaintext
15 lines
979 B
Plaintext
//"fancy" math for calculating time in ms from tick_usage percentage and the length of ticks
|
|
//percent_of_tick_used * (ticklag * 100(to convert to ms)) / 100(percent ratio)
|
|
//collapsed to percent_of_tick_used * tick_lag
|
|
#define TICK_DELTA_TO_MS(percent_of_tick_used) ((percent_of_tick_used) * world.tick_lag)
|
|
#define TICK_USAGE_TO_MS(starting_tickusage) (TICK_DELTA_TO_MS(TICK_USAGE-starting_tickusage))
|
|
|
|
//time of day but automatically adjusts to the server going into the next day within the same round.
|
|
//for when you need a reliable time number that doesn't depend on byond time.
|
|
#define REALTIMEOFDAY (world.timeofday + (MIDNIGHT_ROLLOVER * MIDNIGHT_ROLLOVER_CHECK))
|
|
#define MIDNIGHT_ROLLOVER_CHECK ( rollovercheck_last_timeofday != world.timeofday ? update_midnight_rollover() : midnight_rollovers )
|
|
|
|
#define CEILING(x, y) ( -round(-(x) / (y)) * (y) )
|
|
// round() acts like floor(x, 1) by default but can't handle other values
|
|
#define FLOOR(x, y) ( round((x) / (y)) * (y) )
|