Skip to content

Commit 5f6b962

Browse files
Move is_night() from Dog to BaseMonster
1 parent 831186f commit 5f6b962

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

src/xrGame/ai/monsters/basemonster/base_monster.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
#include "ai_space.h"
4444
#include "xrScriptEngine/script_engine.hpp"
4545
#include "ai/monsters/anti_aim_ability.h"
46+
#include "date_time.h"
4647

4748
// Lain: added
4849
#include "level_debug.h"
@@ -946,6 +947,17 @@ bool CBaseMonster::check_eated_corpse_draggable()
946947
return false;
947948
}
948949

950+
bool CBaseMonster::is_night()
951+
{
952+
u32 year = 0, month = 0, day = 0, hours = 0, mins = 0, secs = 0, milisecs = 0;
953+
split_time(Level().GetGameTime(), year, month, day, hours, mins, secs, milisecs);
954+
if (hours <= db().m_dwDayTimeBegin || hours >= db().m_dwDayTimeEnd)
955+
{
956+
return true;
957+
}
958+
return false;
959+
}
960+
949961
//-------------------------------------------------------------------
950962
// CBaseMonster's Atack on Move
951963
//-------------------------------------------------------------------

src/xrGame/ai/monsters/basemonster/base_monster.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,7 @@ class CBaseMonster : public CCustomMonster, public CStepManager, public CInvento
265265
const CEntityAlive* EatedCorpse;
266266
// Lain: added
267267
bool check_eated_corpse_draggable();
268+
bool is_night();
268269
virtual bool is_base_monster_with_enemy() { return EnemyMan.get_enemy() != NULL; }
269270
bool hear_dangerous_sound;
270271
bool hear_interesting_sound;

src/xrGame/ai/monsters/dog/dog.cpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
#include "ai/monsters/monster_velocity_space.h"
55
#include "ai/monsters/control_animation_base.h"
66
#include "ai/monsters/control_movement_base.h"
7-
#include "date_time.h"
87
#include "Include/xrRender/KinematicsAnimated.h"
98
#include "ai/monsters/monster_home.h"
109
#include "ai/monsters/ai_monster_squad.h"
@@ -194,17 +193,6 @@ void CAI_Dog::UpdateCL()
194193
}
195194
}
196195

197-
bool CAI_Dog::is_night()
198-
{
199-
u32 year = 0, month = 0, day = 0, hours = 0, mins = 0, secs = 0, milisecs = 0;
200-
split_time(Level().GetGameTime(), year, month, day, hours, mins, secs, milisecs);
201-
if (hours <= 6 || hours >= 21)
202-
{
203-
return true;
204-
}
205-
return false;
206-
}
207-
208196
void CAI_Dog::CheckSpecParams(u32 spec_params)
209197
{
210198
if ((spec_params & ASP_CHECK_CORPSE) == ASP_CHECK_CORPSE)

src/xrGame/ai/monsters/dog/dog.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ class CAI_Dog : public CBaseMonster, public CControlledEntity<CAI_Dog>
3434
void set_custom_anim_state(bool b_state_animation);
3535
u32 get_number_animation();
3636
u32 random_anim();
37-
bool is_night();
3837

3938
bool b_end_state_eat;
4039
bool b_state_check;

0 commit comments

Comments
 (0)