1
This commit is contained in:
parent
5e3b8e2774
commit
ee22da622e
@ -2825,7 +2825,7 @@ void Creature::OnBattleStart(Room* room)
|
|||||||
|
|
||||||
bool Creature::CanFollow(Creature* follower)
|
bool Creature::CanFollow(Creature* follower)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG1
|
||||||
return false;
|
return false;
|
||||||
#endif
|
#endif
|
||||||
if (follower->GetUniId() == GetUniId()) {
|
if (follower->GetUniId() == GetUniId()) {
|
||||||
|
@ -171,6 +171,7 @@ class Creature : public MoveableEntity
|
|||||||
bool IsHuman() const;
|
bool IsHuman() const;
|
||||||
bool IsCar() const;
|
bool IsCar() const;
|
||||||
Human* AsHuman() { return IsHuman() ? (Human*)this : nullptr; };
|
Human* AsHuman() { return IsHuman() ? (Human*)this : nullptr; };
|
||||||
|
Player* AsPlayer() { return IsPlayer() ? (Player*)this : nullptr; };
|
||||||
Car* AsCar() { return IsCar() ? (Car*)this : nullptr; };
|
Car* AsCar() { return IsCar() ? (Car*)this : nullptr; };
|
||||||
virtual void DecHP(float dec_hp, int killer_id, const std::string& killer_name, int weapon_id) {};
|
virtual void DecHP(float dec_hp, int killer_id, const std::string& killer_name, int weapon_id) {};
|
||||||
void AddHp(float hp);
|
void AddHp(float hp);
|
||||||
|
@ -3721,10 +3721,12 @@ void Human::DoFollow(int target_id)
|
|||||||
.SetSender(this),
|
.SetSender(this),
|
||||||
[] (const a8::XParams& param)
|
[] (const a8::XParams& param)
|
||||||
{
|
{
|
||||||
Player* hum = (Player*)param.sender.GetUserData();
|
Human* hum = (Human*)param.sender.GetUserData();
|
||||||
if (!hum->follow_target.Get()) {
|
if (!hum->follow_target.Get()) {
|
||||||
hum->moving = false;
|
if (hum->IsPlayer()) {
|
||||||
hum->moved_frames = 0;
|
hum->AsPlayer()->moving = false;
|
||||||
|
hum->AsPlayer()->moved_frames = 0;
|
||||||
|
}
|
||||||
hum->room->xtimer.DeleteTimer(hum->room->xtimer.GetRunningTimer());
|
hum->room->xtimer.DeleteTimer(hum->room->xtimer.GetRunningTimer());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user