Jump to content

Forums Announcement

Read-Only Mode for Announcements & Changelogs

Dear Survivors, we'd like to inform you that this forum will transition to read-only mode. From now on, it will serve exclusively as a platform for official announcements and changelogs.

For all community discussions, debates, and engagement, we encourage you to join us on our social media platforms: Discord, Twitter/X, Facebook.

Thank you for being a valued part of our community. We look forward to connecting with you on our other channels!

Stay safe out there,
Your DayZ Team

Ivan Connor

INIT.C always resets DATE

Recommended Posts

Can anyone tell me why the date is always being reset ? I don't get it. See "DATE RESET AFTER ECONOMY INIT" in INIT.C:

void main()
{
    //INIT ECONOMY--------------------------------------
    Hive ce = CreateHive();
    if ( ce )
        ce.InitOffline();

    //DATE RESET AFTER ECONOMY INIT-------------------------
    int year, month, day, hour, minute;
    int reset_month = 9, reset_day = 20;
    GetGame().GetWorld().GetDate(year, month, day, hour, minute);

    if ((month == reset_month) && (day < reset_day))
    {
        GetGame().GetWorld().SetDate(year, reset_month, reset_day, hour, minute);
    }
    else
    {
        if ((month == reset_month + 1) && (day > reset_day))
        {
            GetGame().GetWorld().SetDate(year, reset_month, reset_day, hour, minute);
        }
        else
        {
            if ((month < reset_month) || (month > reset_month + 1))
            {
                GetGame().GetWorld().SetDate(year, reset_month, reset_day, hour, minute);
            }
        }
    }
}

It really makes no sense to me. I don't understand why this is always done.

Thanks in Advance

Edited by Ivan Connor
  • Thanks 1

Share this post


Link to post
Share on other sites
On 6/2/2024 at 7:06 PM, Ivan Connor said:

Can anyone tell me why the date is always being reset ? I don't get it. See "DATE RESET AFTER ECONOMY INIT" in INIT.C:

void main()
{
    //INIT ECONOMY--------------------------------------
    Hive ce = CreateHive();
    if ( ce )
        ce.InitOffline();

    //DATE RESET AFTER ECONOMY INIT-------------------------
    int year, month, day, hour, minute;
    int reset_month = 9, reset_day = 20;
    GetGame().GetWorld().GetDate(year, month, day, hour, minute);

    if ((month == reset_month) && (day < reset_day))
    {
        GetGame().GetWorld().SetDate(year, reset_month, reset_day, hour, minute);
    }
    else
    {
        if ((month == reset_month + 1) && (day > reset_day))
        {
            GetGame().GetWorld().SetDate(year, reset_month, reset_day, hour, minute);
        }
        else
        {
            if ((month < reset_month) || (month > reset_month + 1))
            {
                GetGame().GetWorld().SetDate(year, reset_month, reset_day, hour, minute);
            }
        }
    }
}

It really makes no sense to me. I don't understand why this is always done.

Thanks in Advance

Then don't waste your time, comment it out and test for 2 weeks. Then type the results and you'll find the reason is done for some special purpose or it's done for nothing.

No, I'm not about to offend, i just suggesting you to explore and find the way how you wish to see it.

Share this post


Link to post
Share on other sites

Yeah, that's what I always do... And I disabled that reset soon after that post because it doesn't make sense at all. Think it's a leftover from testing. Cheers.

Share this post


Link to post
Share on other sites

×