[Tutorial] Fix Fall Damage
open your warz server.sln
search
PHP Code:
void obj_ServerPlayer::OnNetPacket(const PKT_C2S_FallingDamage_s& n){
r3dOutToLog("Falling damage to %s, damage=%.2f\n", Name.c_str(), n.damage); CLOG_INDENT;
gServerLogic.ApplyDamage(this, this, GetPosition(), n.damage, true, storecat_INVALID);
}
change to
PHP Code:
void obj_ServerPlayer::OnNetPacket(const PKT_C2S_FallingDamage_s& n){
float nulldamage = 0.f;
r3dOutToLog("Falling damage to %s, damage=%.2f\n", Name.c_str(), nulldamage); CLOG_INDENT;
gServerLogic.ApplyDamage(this, this, GetPosition(), nulldamage, true, storecat_INVALID);
}
Credits: vinnieshuda
Re: [Tutorial] Fix Fall Damage
this is stupid, if you dont want to take fall damage you should've removed it in your released client. if you decide to remove it on the server you should just drop the packet instead of sending a 0 damage packet back to the player, eating bandwidth and wasting cpu cycles.
Code:
void obj_ServerPlayer::OnNetPacket(const PKT_C2S_FallingDamage_s& n)
{
//r3dOutToLog("Falling damage to %s, damage=%.2f\n", Name.c_str(), n.damage); CLOG_INDENT;
//gServerLogic.ApplyDamage(this, this, GetPosition(), n.damage, true, storecat_INVALID);
}
Re: [Tutorial] Fix Fall Damage
What the @ Izeliae said is correct and also your way @ doidloko when the player falls down a mountain or the game will make the effects of damage (blood on screen and noise of pain) where 0 is returned damage. it can scare the player, thinking ta getting shot or something ... The best method is to comment and leave it empty. But do not remove the function completely because somewhere it is called and this crash can occur.
Re: [Tutorial] Fix Fall Damage
new
void obj_ServerPlayer::OnNetPacket(const PKT_C2S_FallingDamage_s& n)
{
r3dOutToLog("Falling damage to %s, damage=%.2f\n", Name.c_str(), n.damage); CLOG_INDENT;
r3dOutToLog("Falling damage Disable\n", Name.c_str(), n.damage); CLOG_INDENT; // No Damage Enabled
if (!profile_.ProfileData.isDevAccount)
{
gServerLogic.ApplyDamage(this, this, GetPosition(), n.damage, true, storecat_INVALID,false);
}
}
Re: [Tutorial] Fix Fall Damage
This is the fix.
Search
Quote:
desc.nonWalkableMode = PxCCTNonWalkableMode::ePREVENT_CLIMBING;
Change to
Quote:
desc.nonWalkableMode = PxCCTNonWalkableMode::eFORCE_SLIDING;
Re: [Tutorial] Fix Fall Damage
@DNC New Source not working standart fall damage disable(HOW TO DISABLE FALL DAMAGE?)
This tut not working with new Dnc source
EDIT by DNC:
Would the OP be interested in modifying this tutorial to work with the new Community Edition code?
Moved and edited post.
Thank you
Re: [Tutorial] Fix Fall Damage
desc.material = g_pPhysicsWorld->PhysXSDK->createMaterial(0.5f, 0.5f, 0.1f);
desc.userData = (void*)physCallbackObj;
desc.nonWalkableMode = PxCCTNonWalkableMode::ePREVENT_CLIMBING;
//desc.nonWalkableMode = PxCCTNonWalkableMode::eFORCE_SLIDING; // Fix Fall Damage by stargate75
desc.groupsBitmask = 1<<params.type;
dnc 2014
???