//------------------------------------------------------------------------ int CScriptBind_Vehicle::ExitVehicle(IFunctionHandler* pH, ScriptHandle actorHandle) { CVehicle* pVehicle = GetVehicle(pH); if (!pVehicle || !actorHandle.n) return pH->EndFunction(0); if (IVehicleSeat* pSeat = pVehicle->GetSeatForPassenger((EntityId)actorHandle.n)) { bool ret = pSeat->Exit(true); return pH->EndFunction(ret); } return pH->EndFunction(false); }
//------------------------------------------------------------------------ int CScriptBind_Vehicle::ProcessPassengerDamage(IFunctionHandler* pH, ScriptHandle passengerHandle, float actorHealth, float damage, int hitTypeId, bool explosion) { CVehicle* pVehicle = GetVehicle(pH); if (!pVehicle || !passengerHandle.n) return pH->EndFunction(0.0f); if (CVehicleSeat* pSeat = (CVehicleSeat*)pVehicle->GetSeatForPassenger((EntityId)passengerHandle.n)) { float newDamage = pSeat->ProcessPassengerDamage(actorHealth, damage, hitTypeId, explosion); return pH->EndFunction(newDamage); } return pH->EndFunction(0.0f); }