Merge pull request #41 from V0idCipher/vet-reward-81-month-CD-bugfix

WIP: bugfix: fixed CD timer on instance lockout reset terminal
This commit is contained in:
IrishDarkshadow
2019-09-04 00:02:05 +01:00
committed by GitHub

View File

@@ -41,11 +41,11 @@ public class vet_instance_reset extends script.base_script
forceCloseSUIPage(pid);
}
//ADDED for time management
int currentGameTime = getGameTime();
int currentGameTime = getCalendarTime();
if(hasObjVar(self, "used.timestamp"))
{
int lastUsed = getIntObjVar(self, "used.timestamp");
if(currentGameTime < (lastUsed*2))
if(currentGameTime < (lastUsed + 172800))
{
//TODO: add message here to tell player it aint time yet
return SCRIPT_CONTINUE; //If it hasn't been 2 days yet, don't allow them to continue.
@@ -86,10 +86,10 @@ public class vet_instance_reset extends script.base_script
if (hasObjVar(self, "used.timestamp"))
{
int timeStamp = getIntObjVar(self, "used.timestamp");
int rightNow = getGameTime();
if(rightNow < (timeStamp*2))
int rightNow = getCalendarTime();
if(rightNow < (timeStamp + 172800))
{
int dieTime = (timeStamp*2) - rightNow;
int dieTime = (timeStamp + 172800) - rightNow;
names[idx] = "storyteller_time_remaining";
attribs[idx] = utils.formatTimeVerbose(dieTime);
idx++;
@@ -117,11 +117,11 @@ public class vet_instance_reset extends script.base_script
return SCRIPT_CONTINUE;
}
//ADDED for time management
int currentGameTime = getGameTime();
int currentGameTime = getCalendarTime();
if(hasObjVar(self, "used.timestamp"))
{
int lastUsed = getIntObjVar(self, "used.timestamp");
if(currentGameTime < (lastUsed*2))
if(currentGameTime < (lastUsed + 172800))
{
//TODO: add message here to tell player it aint time yet
return SCRIPT_CONTINUE; //If it hasn't been 2 days yet, don't allow them to continue.
@@ -190,11 +190,11 @@ public class vet_instance_reset extends script.base_script
return SCRIPT_CONTINUE;
}
//ADDED for time management
int currentGameTime = getGameTime();
int currentGameTime = getCalendarTime();
if(hasObjVar(self, "used.timestamp"))
{
int lastUsed = getIntObjVar(self, "used.timestamp");
if(currentGameTime < (lastUsed*2))
if(currentGameTime < (lastUsed + 172800))
{
//TODO: add message here to tell player it aint time yet
return SCRIPT_CONTINUE; //If it hasn't been 2 days yet, don't allow them to continue.
@@ -265,7 +265,7 @@ public class vet_instance_reset extends script.base_script
removeObjVar(self, "used.timestamp");
}
setObjVar(self, "used.timestamp", getGameTime());
setObjVar(self, "used.timestamp", getCalendarTime());
//destroyObject(self);
return SCRIPT_CONTINUE;
}