This commit is contained in:
aozhiwei 2022-09-09 11:24:51 +08:00
parent a932e54597
commit ab509ec6e9

View File

@ -31,15 +31,27 @@ void Weapon::Recalc()
int Weapon::GetClipVolume(Creature* c)
{
return c->GetBattleContext()->GetClipVolume(c, this);
if (c->GetBattleContext()) {
return c->GetBattleContext()->GetClipVolume(c, this);
} else {
return meta ? meta->i->clip_volume() :0;
}
}
int Weapon::GetFireRate(Creature* c)
{
return c->GetBattleContext()->GetFireRate(c, this);
if (c->GetBattleContext()) {
return c->GetBattleContext()->GetFireRate(c, this);
} else {
return meta ? meta->i->fire_rate() :0;
}
}
int Weapon::GetReloadTime(Creature* c)
{
return c->GetBattleContext()->GetReloadTime(c, this);
if (c->GetBattleContext()) {
return c->GetBattleContext()->GetReloadTime(c, this);
} else {
return meta ? meta->i->reload_time() :0;
}
}