机器人Ok

This commit is contained in:
aozhiwei 2019-05-17 13:05:52 +08:00
parent 1656f6000c
commit b2f0e4f111
3 changed files with 14 additions and 10 deletions

View File

@ -24,15 +24,6 @@ void Android::Initialize()
health = meta->i->health(); health = meta->i->health();
skin = 14001; skin = 14001;
RecalcSelfCollider(); RecalcSelfCollider();
MetaData::Equip* weapon_meta = MetaMgr::Instance()->GetEquip(a8::RandEx(12103, 12122));
if (weapon_meta) {
weapons[GUN_SLOT1].weapon_idx = GUN_SLOT1;
weapons[GUN_SLOT1].weapon_id = weapon_meta->i->id();
weapons[GUN_SLOT1].weapon_lv = 1;
weapons[GUN_SLOT1].ammo = 0;
weapons[GUN_SLOT1].meta = weapon_meta;
curr_weapon = &weapons[GUN_SLOT1];
}
} }
void Android::Update(int delta_time) void Android::Update(int delta_time)

View File

@ -717,6 +717,17 @@ bool Human::HasNoDownedTeammate()
void Human::Land() void Human::Land()
{ {
a8::UnSetBitFlag(status, HS_Jump); a8::UnSetBitFlag(status, HS_Jump);
if (entity_subtype == EST_Android) {
MetaData::Equip* weapon_meta = MetaMgr::Instance()->GetEquip(a8::RandEx(12103, 12122));
if (weapon_meta) {
weapons[GUN_SLOT1].weapon_idx = GUN_SLOT1;
weapons[GUN_SLOT1].weapon_id = weapon_meta->i->id();
weapons[GUN_SLOT1].weapon_lv = 1;
weapons[GUN_SLOT1].ammo = 0;
weapons[GUN_SLOT1].meta = weapon_meta;
curr_weapon = &weapons[GUN_SLOT1];
}
}
FindLocation(); FindLocation();
SyncAroundPlayers(); SyncAroundPlayers();
} }

View File

@ -175,7 +175,9 @@ void Room::AddPlayer(Player* hum)
hum->FindLocation(); hum->FindLocation();
hum->RefreshView(); hum->RefreshView();
MatchTeam(hum); MatchTeam(hum);
RandRemoveAndroid(); while (human_hash_.size() > ROOM_MAX_PLAYER_NUM) {
RandRemoveAndroid();
}
} }
unsigned short Room::AllocUniid() unsigned short Room::AllocUniid()