1
This commit is contained in:
parent
8adfe56d7b
commit
a38978a4fd
@ -80,6 +80,7 @@ void Car::FillMFObjectFull(Room* room, Human* hum, cs::MFObjectFull* full_data)
|
|||||||
p->set_oil(cur_oil_);
|
p->set_oil(cur_oil_);
|
||||||
p->set_max_oil(meta->i->max_oil());
|
p->set_max_oil(meta->i->max_oil());
|
||||||
p->set_bullet_num(weapons[GUN_SLOT1].ammo);
|
p->set_bullet_num(weapons[GUN_SLOT1].ammo);
|
||||||
|
p->set_seat_num(meta->int_param2);
|
||||||
FillBuffList(hum, p->mutable_buff_list());
|
FillBuffList(hum, p->mutable_buff_list());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -186,28 +187,35 @@ void Car::GetOn(Human* passenger)
|
|||||||
|
|
||||||
void Car::SwitchSeat(Human* passenger, int seat)
|
void Car::SwitchSeat(Human* passenger, int seat)
|
||||||
{
|
{
|
||||||
if (seat != 0) {
|
if (later_removed_) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (driver_) {
|
if (seat < 0 || seat >= meta->int_param2) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!IsPassenger(passenger)) {
|
if (!IsPassenger(passenger)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (passenger->GetSeat() == seat) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (GetPassengerBySeat(seat)) {
|
if (GetPassengerBySeat(seat)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!IsDriver(passenger)) {
|
|
||||||
|
if (seat == 0) {
|
||||||
passenger->RemoveBuffByEffectId(kBET_Passenger);
|
passenger->RemoveBuffByEffectId(kBET_Passenger);
|
||||||
passenger->SetSeat(seat);
|
passenger->SetSeat(seat);
|
||||||
driver_ = passenger;
|
driver_ = passenger;
|
||||||
passenger->MustBeAddBuff(passenger, DRIVER_BUFFID);
|
passenger->MustBeAddBuff(passenger, DRIVER_BUFFID);
|
||||||
room->frame_event.AddCarChg(passenger->GetWeakPtrRef());
|
room->frame_event.AddCarChg(passenger->GetWeakPtrRef());
|
||||||
SyncAroundPlayers(__FILE__, __LINE__, __func__);
|
SyncAroundPlayers(__FILE__, __LINE__, __func__);
|
||||||
|
} else {
|
||||||
|
if (driver_ == passenger) {
|
||||||
|
driver_ = nullptr;
|
||||||
|
passenger->RemoveBuffByEffectId(kBET_Driver);
|
||||||
|
passenger->MustBeAddBuff(passenger, PASSENGER_BUFFID);
|
||||||
|
}
|
||||||
|
passenger->SetSeat(seat);
|
||||||
|
room->frame_event.AddCarChg(passenger->GetWeakPtrRef());
|
||||||
|
SyncAroundPlayers(__FILE__, __LINE__, __func__);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1151,7 +1151,7 @@ void Player::_CMMove(f8::MsgHdr& hdr, const cs::CMMove& msg)
|
|||||||
get_on = msg.get_on();
|
get_on = msg.get_on();
|
||||||
}
|
}
|
||||||
if (msg.has_switch_seat()) {
|
if (msg.has_switch_seat()) {
|
||||||
switch_seat = msg.has_switch_seat();
|
switch_seat = msg.has_switch_seat() + 1;
|
||||||
}
|
}
|
||||||
if (msg.has_jump()) {
|
if (msg.has_jump()) {
|
||||||
jump = true;
|
jump = true;
|
||||||
|
@ -484,6 +484,7 @@ message MFCarFull
|
|||||||
!!!注意这里只返回客户端必要的用于显示玩家外观的信息而不是全量信息
|
!!!注意这里只返回客户端必要的用于显示玩家外观的信息而不是全量信息
|
||||||
*/
|
*/
|
||||||
repeated MFPlayerFull passengers = 6;
|
repeated MFPlayerFull passengers = 6;
|
||||||
|
optional int32 seat_num = 17; //座位数
|
||||||
optional int32 born_frameno = 8; //出生帧号 born_frameno == SMUpdate.frmanoe时表示在当前这帧出生
|
optional int32 born_frameno = 8; //出生帧号 born_frameno == SMUpdate.frmanoe时表示在当前这帧出生
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user