Refactored the world time.
Now it is stored in two values - WorldAge (only incremented, plugins cannot change) and TimeOfDay (plugins can change). Since sub-tick precision is needed in Tick(), we store it both as number of seconds (double) and number of ticks (Int64) is calculated off of that. git-svn-id: http://mc-server.googlecode.com/svn/trunk@1022 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
@@ -39,9 +39,10 @@ void cSkeleton::Tick(float a_Dt)
|
||||
{
|
||||
cMonster::Tick(a_Dt);
|
||||
|
||||
//TODO Outsource
|
||||
//TODO should do lightcheck, not daylight -> mobs in the dark don´t burn
|
||||
if (GetWorld()->GetWorldTime() < (12000 + 1000) && GetMetaData() != BURNING ) { //if daylight
|
||||
// TODO Outsource
|
||||
// TODO should do SkyLight check, mobs in the dark don´t burn
|
||||
if ((GetWorld()->GetTimeOfDay() < (12000 + 1000)) && (GetMetaData() != BURNING))
|
||||
{
|
||||
SetMetaData(BURNING); // BURN, BABY, BURN! >:D
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user