• New Horizons on Maelstrom
    Maelstrom New Horizons


    Visit our website www.piratehorizons.com to quickly find download links for the newest versions of our New Horizons mods Beyond New Horizons and Maelstrom New Horizons!

Need Help Help fix SetCurrentTime

Myth

Freebooter
Good afternoon. Found a bug in a standard function. By default, time just changes. There is no check that the current time is more than new. I could add her. I can not add verification for the following case. For example, the time is 23 hours. And I put 9 hours. How to check such cases?

void SetCurrentTime(int hour, int minutes)
{
if(Environment.date.hour > hour)
{
AddDataToCurrent(0,0,1);
}
if(Environment.date.hour == hour && Environment.date.min > minutes)
{
AddDataToCurrent(0,0,1);
}
if(hour < Environment.date.hour)
{
// ???
}
Environment.date.hour = makefloat(hour);
Environment.date.min = makefloat(minutes);
Environment.time = makefloat(hour) + makefloat(minutes)/60.0;
worldMap.date.hour = makefloat(hour);
worldMap.date.min = makefloat(minutes);
DoQuestCheckDelay("restore_gun", 0.2);
}
 
@kb31, @konradk or @ChezJfrey, do you have any ideas?

void SetCurrentTime(int hour, int minutes)
{
if(Environment.date.hour > hour)
{
AddDataToCurrent(0,0,1);
}
if(Environment.date.hour == hour && Environment.date.min > minutes)
{
AddDataToCurrent(0,0,1);
}

Environment.date.hour = makefloat(hour);
Environment.date.min = makefloat(minutes);
Environment.time = makefloat(hour) + makefloat(minutes)/60.0;
worldMap.date.hour = makefloat(hour);
worldMap.date.min = makefloat(minutes);
DoQuestCheckDelay("restore_gun", 0.2);
}

Strange as that. But it seems like in this form, without the third condition, the game correctly wraps the function.
 
Back
Top