ลืมรหัสผ่าน
 ลงทะเบียน
ค้นหา
ดู: 756|ตอบกลับ: 0

เกิดที่เดิม Cr.Wang Natthawut

[คัดลอกลิงก์]
โพสต์ 2017-1-13 16:31:18 | ดูโพสต์ทั้งหมด |โหมดอ่าน | Google Chrome 55.0.2883.87| Windows 7
เกิดที่เดิมนะ
void ServerGameLogic::GetStartSpawnPosition(const wiCharDataFull& loadout, r3dPoint3D* pos, float* dir, bool& needsSpawnProtection)
{
needsSpawnProtection = false;


// if no map assigned yet, or new map, or newly created character (alive == 3) or joining PTE map
if(loadout.GameMapId == 0 || loadout.GameMapId != ginfo_.mapId || loadout.Alive == 3
#ifdef DISABLE_GI_ACCESS_ON_PTE_MAP
|| ginfo_.channel == 6
#endif
#ifdef DISABLE_GI_ACCESS_ON_PTE_STRONGHOLD_MAP
|| (ginfo_.channel == 6 && ginfo_.mapId==GBGameInfo::MAPID_WZ_Cliffside)
#endif
#ifdef DISABLE_GI_ACCESS_FOR_CALI_SERVER
|| (gServerLogic.ginfo_.mapId==GBGameInfo::MAPID_WZ_California)
#endif
)
{
needsSpawnProtection = true;
GetSpawnPositionNewPlayer(loadout.GamePos, pos, dir);
// move spawn pos at radius
pos->x += u_GetRandom(-_glm_SpawnRadius, _glm_SpawnRadius);
pos->z += u_GetRandom(-_glm_SpawnRadius, _glm_SpawnRadius);
//r3dOutToLog("new spawn at position %f %f %f\n", pos->x, pos->y, pos->z);
return;
}
//ตายเกิดบนแมพ
// alive at current map
if(loadout.GameMapId && (loadout.GameMapId == ginfo_.mapId) && loadout.Alive == 1)
{
needsSpawnProtection = true;
GetSpawnPositionAfterDeath2(loadout.GamePos, pos, dir);
// move spawn pos at radius
pos->x += u_GetRandom(-_glm_SpawnRadius, _glm_SpawnRadius);
pos->z += u_GetRandom(-_glm_SpawnRadius, _glm_SpawnRadius);
//r3dOutToLog("revived at position %f %f %f\n", pos->x, pos->y, pos->z);
return;
}
needsSpawnProtection = false;
PxRaycastHit hit;
PxSceneQueryFilterData filter(PxFilterData(COLLIDABLE_STATIC_MASK,0,0,0), PxSceneQueryFilterFlags(PxSceneQueryFilterFlag::eSTATIC|PxSceneQueryFilterFlag::eDYNAMIC));
bool hitResult = g_pPhysicsWorld->raycastSingle(PxVec3(loadout.GamePos.x, loadout.GamePos.y + 0.5f, loadout.GamePos.z), PxVec3(0, -1, 0), 500.0f, PxSceneQueryFlags(PxSceneQueryFlag::eIMPACT), hit, filter);
r3dPoint3D posForWater = loadout.GamePos;
if( hitResult )
posForWater = r3dPoint3D(hit.impact.x, hit.impact.y, hit.impact.z); // This is the ground position underwater.

float waterDepth = getWaterDepthAtPos(posForWater);

//r3dOutToLog("!!! WaterCheck Hit: %d, Depth: %.3f, Impact: %.3f, %.3f, %.3f\n", (int)hitResult, waterDepth, posForWater.x, posForWater.y, posForWater.z);

const float allowedDepth = 1.5f;
if(waterDepth > allowedDepth) // too deep, start swimming
{
*pos = r3dPoint3D(posForWater.x, posForWater.y + (waterDepth - allowedDepth), posForWater.z); // adjust to water, in case player logged out while swimming
}
else
{
*pos = AdjustPositionToFloor(loadout.GamePos); // adjust to floor, in case if player logged out while being on top of other player or anything like that
}
*dir = loadout.GameDir;
//r3dOutToLog("alive at position %.3f %.3f %.3f\n", pos->x, pos->y, pos->z);
return;
}

// revived (alive == 2) - spawn to closest spawn point
if(loadout.GameMapId && (loadout.Alive == 1)
{
needsSpawnProtection = true;
GetSpawnPositionAfterDeath2(loadout.GamePos, pos, dir);
// move spawn pos at radius
pos->x += u_GetRandom(-_glm_SpawnRadius, _glm_SpawnRadius);
pos->z += u_GetRandom(-_glm_SpawnRadius, _glm_SpawnRadius);
//r3dOutToLog("revived at position %f %f %f\n", pos->x, pos->y, pos->z);
return;
}

r3dOutToLog("%d %d %d\n", loadout.GameMapId, loadout.Alive, ginfo_.mapId);
r3d_assert(false && "GetStartSpawnPosition");
}


ขออภัย! คุณไม่ได้รับสิทธิ์ในการดำเนินการในส่วนนี้ กรุณาเลือกอย่างใดอย่างหนึ่ง เข้าสู่ระบบ | ลงทะเบียน

รายละเอียดเครดิต

ประวัติการแบน|Library IT ศูนย์รวมความรู้ทุกเรื่อง เพื่อป้องการอาชยากรรมทางไซเบอร์ไกล้ตัว

GMT+7, 2024-4-19 09:15 , Processed in 0.053913 second(s), 16 queries .

Powered by Discuz! X3.5, Rev.8

© 2001-2024 Discuz! Team.

ตอบกระทู้ ขึ้นไปด้านบน ไปที่หน้ารายการกระทู้