Ticket #38: mypatch.patch
| File mypatch.patch, 9.7 KB (added by bigjj13, 21 months ago) |
|---|
-
C:/Cafu-src-r76/Games/DeathMatch/Code/
old new 169 169 // Only human players that are still alive can take damage. 170 170 if (State.StateOfExistance!=StateOfExistance_Alive) return; 171 171 172 State.Velocity=State.Velocity+scale(VectorT(ImpactDir.x, ImpactDir.y, 0.0), 500.0*Amount);172 State.Velocity=State.Velocity+scale(VectorT(ImpactDir.x, ImpactDir.y, 0.0), 100.0*Amount); 173 173 174 174 if (State.Health<=Amount) 175 175 { … … 237 237 ModelProxyT("Games/DeathMatch/Models/Players/Sentinel.mdl"), 238 238 ModelProxyT("Games/DeathMatch/Models/Players/Skeleton.mdl"), 239 239 ModelProxyT("Games/DeathMatch/Models/Players/T801.mdl" ), 240 ModelProxyT("Games/DeathMatch/Models/Players/Jaffa.mdl" ), 241 ModelProxyT("Games/DeathMatch/Models/Players/USCM.mdl" ), 240 242 ModelProxyT("Games/DeathMatch/Models/Players/Trinity.mdl" ) 241 243 }; 242 244 … … 258 260 else if (_stricmp((const char*)ConfigData, "Sentinel")==0) State.ModelIndex=3; 259 261 else if (_stricmp((const char*)ConfigData, "Skeleton")==0) State.ModelIndex=4; 260 262 else if (_stricmp((const char*)ConfigData, "T801" )==0) State.ModelIndex=5; 261 else State.ModelIndex=6; 263 else if (_stricmp((const char*)ConfigData, "Jaffa" )==0) State.ModelIndex=6; 264 else if (_stricmp((const char*)ConfigData, "USCM" )==0) State.ModelIndex=7; 265 else State.ModelIndex=8; 262 266 } 263 267 264 268 // player name … … 410 414 411 415 VectorT WishVelocity; 412 416 bool WishJump=false; 413 const double VelX =6000.0*LookupTables::Angle16ToSin[State.Heading]; // 6000 == Client.MoveSpeed 414 const double VelY =6000.0*LookupTables::Angle16ToCos[State.Heading]; // 6000 == Client.MoveSpeed 417 char Runspon=0; 418 const double VelX =3000.0*LookupTables::Angle16ToSin[State.Heading]; // 6000 == Client.MoveSpeed 419 const double VelY =3000.0*LookupTables::Angle16ToCos[State.Heading]; // 6000 == Client.MoveSpeed 415 420 const unsigned long Keys =PlayerCommands[PCNr].Keys; 416 421 417 422 if (Keys & PCK_MoveForward ) WishVelocity= VectorT( VelX, VelY, 0); 418 if (Keys & PCK_MoveBackward) WishVelocity=WishVelocity+VectorT(-VelX, -VelY, 0); 423 if (Keys & PCK_MoveBackward) 424 { 425 WishVelocity=WishVelocity+VectorT(-VelX, -VelY, 0); 426 Runspon=3; 427 } 419 428 if (Keys & PCK_StrafeLeft ) WishVelocity=WishVelocity+VectorT(-VelY, VelX, 0); 420 429 if (Keys & PCK_StrafeRight ) WishVelocity=WishVelocity+VectorT( VelY, -VelX, 0); 421 430 422 431 if (Keys & PCK_CenterView ) { State.Pitch=0; State.Bank=0; } 423 if (Keys & PCK_Jump ) WishJump=true; 432 if (Keys & PCK_Jump ) 433 { 434 WishJump=true; 435 Runspon=2; 436 } 424 437 // if (Keys & PCK_Duck ) ; 425 if (Keys & PCK_Walk ) WishVelocity=scale(WishVelocity, 0.5); 438 if (Keys & PCK_Walk ) 439 { 440 if (Runspon!=3) 441 { 442 WishVelocity=scale(WishVelocity, 2.0); //Run 443 if (Runspon==3) Runspon=4; 444 else Runspon=1; 445 } 446 } 426 447 427 448 VectorT WishVelLadder; 428 449 const double ViewLadderZ=-LookupTables::Angle16ToSin[State.Pitch]; 429 450 const double ViewLadderY= LookupTables::Angle16ToCos[State.Pitch]; 430 const VectorT ViewLadder =scale(VectorT(ViewLadderY*LookupTables::Angle16ToSin[State.Heading], ViewLadderY*LookupTables::Angle16ToCos[State.Heading], ViewLadderZ), 3800.0);451 const VectorT ViewLadder =scale(VectorT(ViewLadderY*LookupTables::Angle16ToSin[State.Heading], ViewLadderY*LookupTables::Angle16ToCos[State.Heading], ViewLadderZ), 1900.0); 431 452 432 453 // TODO: Also take LATERAL movement into account. 433 454 // TODO: All this needs a HUGE clean-up! Can probably put a lot of this stuff into Physics::MoveHuman. 434 455 if (Keys & PCK_MoveForward ) WishVelLadder=WishVelLadder+ViewLadder; 435 456 if (Keys & PCK_MoveBackward) WishVelLadder=WishVelLadder-ViewLadder; 436 if (Keys & PCK_Walk ) WishVelLadder=scale(WishVelLadder, 0.5);457 if (Keys & PCK_Walk ) WishVelLadder=scale(WishVelLadder, 2.0); 437 458 438 459 /*if (Clients[ClientNr].move_noclip) 439 460 { … … 469 490 XYVel.z=0; 470 491 double NewSpeed=length(XYVel); 471 492 472 if (OldSpeed<=1000.0 && NewSpeed>1000.0) State.ModelSequNr=3; 473 if (OldSpeed>=1000.0 && NewSpeed<1000.0) State.ModelSequNr=1; 493 if (OldSpeed<=1000.0 && NewSpeed>1000.0) 494 { 495 if (Runspon==1) State.ModelSequNr=3; 496 else if (Runspon==2) State.ModelSequNr=8; 497 else if (Runspon==3) State.ModelSequNr=77; 498 else if (Runspon==4) State.ModelSequNr=9; 499 else State.ModelSequNr=4; 500 } 501 if (OldSpeed>=1000.0 && NewSpeed<1000.0) 502 { 503 if (Runspon==2) State.ModelSequNr=8; 504 else State.ModelSequNr=1; 505 } 474 506 } 475 507 476 508 // GameWorld->ModelAdvanceFrameTime() is called on client side in Draw(). … … 551 583 case WEAPON_SLOT_9MMAR : DrawSequNr=4; break; 552 584 case WEAPON_SLOT_CROSSBOW : DrawSequNr=5; break; 553 585 case WEAPON_SLOT_RPG : DrawSequNr=5; break; 554 case WEAPON_SLOT_GAUSS : DrawSequNr= 8; break;586 case WEAPON_SLOT_GAUSS : DrawSequNr=2; break; 555 587 case WEAPON_SLOT_EGON : DrawSequNr=9; break; 556 588 case WEAPON_SLOT_GRENADE : DrawSequNr=7; break; 557 589 case WEAPON_SLOT_TRIPMINE : DrawSequNr=0; break; … … 581 613 case WEAPON_SLOT_9MMAR : DrawSequNr=4; break; 582 614 case WEAPON_SLOT_CROSSBOW : DrawSequNr=5; break; 583 615 case WEAPON_SLOT_RPG : DrawSequNr=5; break; 584 case WEAPON_SLOT_GAUSS : DrawSequNr= 8; break;616 case WEAPON_SLOT_GAUSS : DrawSequNr=2; break; 585 617 case WEAPON_SLOT_EGON : DrawSequNr=9; break; 586 618 case WEAPON_SLOT_GRENADE : DrawSequNr=7; break; 587 619 case WEAPON_SLOT_TRIPMINE : DrawSequNr=0; break; … … 754 786 // Now leave it only after we have come to a complete halt, and the death sequence is over. 755 787 if (OldOriginZ>=State.Origin.z && fabs(State.Velocity.x)<0.1 && fabs(State.Velocity.y)<0.1 && fabs(State.Velocity.z)<0.1 && OldModelFrameNr==State.ModelFrameNr) 756 788 { 757 std::map<std::string, std::string> Props; Props["classname"]="corpse"; 789 if (ThinkingOnServerSide) 790 { 791 std::map<std::string, std::string> Props; Props["classname"]="corpse"; 758 792 759 // Create a new "corpse" entity in the place where we died, or else the model disappears.760 unsigned long CorpseID=GameWorld->CreateNewEntity(Props, ServerFrameNr, VectorT());793 // Create a new "corpse" entity in the place where we died, or else the model disappears. 794 unsigned long CorpseID=GameWorld->CreateNewEntity(Props, ServerFrameNr, VectorT()); 761 795 762 if (CorpseID!=0xFFFFFFFF)763 {764 BaseEntityT* Corpse=GameWorld->GetBaseEntityByID(CorpseID);796 if (CorpseID!=0xFFFFFFFF) 797 { 798 BaseEntityT* Corpse=GameWorld->GetBaseEntityByID(CorpseID); 765 799 766 Corpse->State=EntityStateT(State.Origin+VectorT(0.0, 0.0, State.Dimensions.Min.z+1728.8), VectorT(), BoundingBox3T<double>(Vector3dT()), State.Heading, 767 0, 0, 0, 0, State.ModelIndex, State.ModelSequNr, State.ModelFrameNr, 0, 0, 0, 0, 768 State.ActiveWeaponSlot, 0, 0.0); 800 Corpse->State=EntityStateT(State.Origin+VectorT(0.0, 0.0, State.Dimensions.Min.z+1728.8), VectorT(), BoundingBox3T<double>(Vector3dT()), State.Heading, 801 0, 0, 0, 0, State.ModelIndex, State.ModelSequNr, State.ModelFrameNr, 0, 0, 0, 0, 802 State.ActiveWeaponSlot, 0, 0.0); 803 } 769 804 } 770 805 771 806 State.Velocity.y=State.Heading; … … 1041 1076 1042 1077 // This is a compromise for the not-so-great code in the constructor: 1043 1078 // Obtain a pointer to our GUI if we haven't one already (so this is a one-time issue). 1044 if (GuiHUD==NULL) GuiHUD=cf::GuiSys::GuiMan->Find("Games/DeathMatch/GUIs/HUD .cgui", true);1079 if (GuiHUD==NULL) GuiHUD=cf::GuiSys::GuiMan->Find("Games/DeathMatch/GUIs/HUD_main.cgui", true); 1045 1080 1046 1081 // Decide whether the GuiHUD should be drawn at all. 1047 1082 const bool ActivateHUD=State.StateOfExistance==StateOfExistance_Alive || State.StateOfExistance==StateOfExistance_Dead;
