Skip to content

Commit

Permalink
Merge pull request #33 from Deaod/v5-maintenance
Browse files Browse the repository at this point in the history
V5 maintenance
  • Loading branch information
Deaod committed Dec 1, 2020
2 parents 0147830 + 4778326 commit c55b6af
Show file tree
Hide file tree
Showing 9 changed files with 104 additions and 75 deletions.
2 changes: 1 addition & 1 deletion Classes/ClientSettings.uc
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ defaultproperties
DesiredTeamSkinFemale=0
bEnableHitSounds=True
selectedHitSound=0
sHitSound(0)="InstaGibPlus5B.HitSound"
sHitSound(0)="InstaGibPlus5C.HitSound"
sHitSound(1)="UnrealShare.StingerFire"
cShockBeam=1
BeamScale=0.45
Expand Down
9 changes: 6 additions & 3 deletions Classes/ST_SuperShockRifle.uc
Original file line number Diff line number Diff line change
Expand Up @@ -156,15 +156,18 @@ simulated function PlayFiring()
{
PlayOwnedSound(FireSound, SLOT_None, Pawn(Owner).SoundDampening*4.0);
if (Level.NetMode == NM_Client)
LoopAnim('Fire1', 0.20 + 0.20 * FireAdjust,0.05);
PlayAnim('Fire1', 0.20 + 0.20 * FireAdjust,0.05);
else
LoopAnim('Fire1', 0.22 + 0.22 * FireAdjust,0.05);
PlayAnim('Fire1', 0.22 + 0.22 * FireAdjust,0.05);
}

simulated function PlayAltFiring()
{
PlayOwnedSound(FireSound, SLOT_None, Pawn(Owner).SoundDampening*4.0);
LoopAnim('Fire1', 0.20 + 0.20 * FireAdjust,0.05);
if (Level.NetMode == NM_Client)
PlayAnim('Fire1', 0.20 + 0.20 * FireAdjust,0.05);
else
PlayAnim('Fire1', 0.22 + 0.22 * FireAdjust,0.05);
}

function AltFire( float Value )
Expand Down
8 changes: 4 additions & 4 deletions Classes/UTPure.uc
Original file line number Diff line number Diff line change
Expand Up @@ -1380,8 +1380,8 @@ defaultproperties
ThrowVelocity=750
VersionStr="IG+"
LongVersion=""
ThisVer="5B"
NiceVer="5B"
ThisVer="5C"
NiceVer="5C"
BADminText="Not allowed - Log in as admin!"
bAlwaysTick=True
NNAnnouncer=True
Expand All @@ -1395,9 +1395,9 @@ defaultproperties
bRestrictTrading=True
MaxTradeTimeMargin=0.1
bEnableServerExtrapolation=True
bEnableJitterBounding=True
bEnableJitterBounding=False
KillCamDelay=0.0
KillCamDuration=2.0
bJumpingPreservesMomentum=False
bEnableSingleButtonDodge=True
bEnableSingleButtonDodge=False
}
41 changes: 31 additions & 10 deletions Classes/bbCHSpectator.uc
Original file line number Diff line number Diff line change
Expand Up @@ -411,10 +411,25 @@ event PostRender( canvas Canvas )
}
}

function xxCalcBehindView(out vector CameraLocation, out rotator CameraRotation, float Dist)
{
local vector View,HitLocation,HitNormal;
local float ViewDist;

CameraRotation = ViewRotation;
View = vect(1,0,0) >> CameraRotation;
if( Trace( HitLocation, HitNormal, CameraLocation - (Dist + 30) * vector(CameraRotation), CameraLocation ) != None )
ViewDist = FMin( (CameraLocation - HitLocation) Dot View, Dist );
else
ViewDist = Dist;
CameraLocation -= (ViewDist - 30) * View;
}

// Fix the "roll" (upside/sideway view) bug.
event PlayerCalcView(out actor ViewActor, out vector CameraLocation, out rotator CameraRotation )
{
local Pawn PTarget;
local bbPlayer bbP;

if ( ViewTarget != None )
{
Expand All @@ -426,34 +441,40 @@ event PlayerCalcView(out actor ViewActor, out vector CameraLocation, out rotator
{
if ( Level.NetMode == NM_Client )
{
if ( PTarget.bIsPlayer )
PTarget.ViewRotation = TargetViewRotation;
if ( PTarget.bIsPlayer ) {
bbP = bbPlayer(PTarget);
if (bbP != none) {
PTarget.ViewRotation.Pitch = bbP.CompressedViewRotation >>> 16;
PTarget.ViewRotation.Yaw = bbP.CompressedViewRotation & 0xFFFF;
PTarget.ViewRotation.Roll = 0;
} else {
PTarget.ViewRotation = TargetViewRotation;
}
}
PTarget.EyeHeight = TargetEyeHeight;
if ( PTarget.Weapon != None )
PTarget.Weapon.PlayerViewOffset = TargetWeaponViewOffset;
}
if ( PTarget.bIsPlayer )
CameraRotation = PTarget.ViewRotation;
if ( !bBehindView )
CameraLocation.Z += PTarget.EyeHeight;
CameraLocation.Z += PTarget.EyeHeight;
}
CameraRotation.Roll = 0;

if ( bBehindView )
CalcBehindView(CameraLocation, CameraRotation, 180);
xxCalcBehindView(CameraLocation, CameraRotation, 180);
return;
}

ViewActor = Self;
CameraLocation = Location;
CameraLocation.Z += EyeHeight;

if( bBehindView ) //up and behind
CalcBehindView(CameraLocation, CameraRotation, 150);
else
{
if( bBehindView ) { //up and behind
xxCalcBehindView(CameraLocation, CameraRotation, 150);
} else {
// First-person view.
CameraRotation = ViewRotation;
CameraLocation.Z += EyeHeight;
CameraLocation += WalkBob;
}
}
Expand Down
95 changes: 50 additions & 45 deletions Classes/bbPlayer.uc
Original file line number Diff line number Diff line change
Expand Up @@ -1888,7 +1888,6 @@ function xxServerMove(

debugClientForceUpdate = false;

PlayerReplicationInfo.Ping = int(ConsoleCommand("GETPING"));
if (SetPendingWeapon) {
xxSetPendingWeapon(PendingWeapon);
zzPendingWeapon = PendingWeapon;
Expand Down Expand Up @@ -2985,12 +2984,12 @@ exec function enableHitSounds(bool b) {

exec function setForcedSkins(int maleSkin, int femaleSkin) {
local bool error;
if (maleSkin <= 0 || maleSkin > 18) {
ClientMessage("Invalid maleSkin, please input a value between 1 and 18");
if (maleSkin < -1 || maleSkin == 0 || maleSkin > 18) {
ClientMessage("Invalid maleSkin, please input a value between 1 and 18, or -1 to disable");
error = true;
}
if (femaleSkin <= 0 || femaleSkin > 18) {
ClientMessage("Invalid femaleSkin, please input a value between 1 and 18");
if (femaleSkin < -1 || femaleSkin == 0 || femaleSkin > 18) {
ClientMessage("Invalid femaleSkin, please input a value between 1 and 18, or -1 to disable");
error = true;
}

Expand All @@ -3007,12 +3006,12 @@ exec function setForcedSkins(int maleSkin, int femaleSkin) {

exec function setForcedTeamSkins(int maleSkin, int femaleSkin) {
local bool error;
if (maleSkin < 0 || maleSkin > 17) {
ClientMessage("Invalid maleSkin, please input a value between 1 and 18");
if (maleSkin < -1 || maleSkin == 0 || maleSkin > 18) {
ClientMessage("Invalid maleSkin, please input a value between 1 and 18, or -1 to disable");
error = true;
}
if (femaleSkin < 0 || femaleSkin > 17) {
ClientMessage("Invalid femaleSkin, please input a value between 1 and 18");
if (femaleSkin < -1 || femaleSkin == 0 || femaleSkin > 18) {
ClientMessage("Invalid femaleSkin, please input a value between 1 and 18, or -1 to disable");
error = true;
}

Expand Down Expand Up @@ -3110,7 +3109,7 @@ function xxCalcBehindView(out vector CameraLocation, out rotator CameraRotation,
event PlayerCalcView(out actor ViewActor, out vector CameraLocation, out rotator CameraRotation )
{
local Pawn PTarget;
local bbPlayer bbTarg;
local bbPlayer bbP;

if (zzInfoThing != None)
zzInfoThing.zzPlayerCalcViewCalls--;
Expand All @@ -3121,25 +3120,27 @@ event PlayerCalcView(out actor ViewActor, out vector CameraLocation, out rotator
CameraLocation = ViewTarget.Location;
CameraRotation = ViewTarget.Rotation;
PTarget = Pawn(ViewTarget);
bbTarg = bbPlayer(ViewTarget);
if ( PTarget != None )
{
if ( Level.NetMode == NM_Client )
{
if ( PTarget.bIsPlayer )
{
if (bbTarg != None)
bbTarg.ViewRotation = TargetViewRotation;
PTarget.ViewRotation = TargetViewRotation;
if ( PTarget.bIsPlayer ) {
bbP = bbPlayer(PTarget);
if (bbp != none) {
PTarget.ViewRotation.Pitch = bbP.CompressedViewRotation >>> 16;
PTarget.ViewRotation.Yaw = bbP.CompressedViewRotation & 0xFFFF;
PTarget.ViewRotation.Roll = 0;
} else {
PTarget.ViewRotation = TargetViewRotation;
}
}
PTarget.EyeHeight = TargetEyeHeight;
if ( PTarget.Weapon != None )
PTarget.Weapon.PlayerViewOffset = TargetWeaponViewOffset;
}
if ( PTarget.bIsPlayer )
CameraRotation = PTarget.ViewRotation;
if ( !bBehindView )
CameraLocation.Z += PTarget.EyeHeight;
CameraLocation.Z += PTarget.EyeHeight;
}
if ( bBehindView )
xxCalcBehindView(CameraLocation, CameraRotation, 180);
Expand All @@ -3148,23 +3149,20 @@ event PlayerCalcView(out actor ViewActor, out vector CameraLocation, out rotator

ViewActor = Self;
CameraLocation = Location;
CameraLocation.Z += EyeHeight;

if( bBehindView ) //up and behind
if( bBehindView ) { //up and behind
xxCalcBehindView(CameraLocation, CameraRotation, 150);
else
{
if (zzbRepVRData)
{ // Received data through demo replication.
} else {
if (zzbRepVRData) {
// Received data through demo replication.
CameraRotation.Yaw = zzRepVRYaw;
CameraRotation.Pitch = zzRepVRPitch;
CameraRotation.Roll = 0;
EyeHeight = zzRepVREye;
}
else if (zzInfoThing != None && zzInfoThing.zzPlayerCalcViewCalls == zzNull)
CameraRotation = ViewRotation;
else
} else {
CameraRotation = ViewRotation;
CameraLocation.Z += EyeHeight;
}
CameraLocation += WalkBob;
}
}
Expand Down Expand Up @@ -3315,21 +3313,22 @@ simulated function bool ClientAdjustHitLocation(out vector HitLocation, vector T

TraceDir = Normal(TraceDir);

if ( (GetAnimGroup(AnimSequence) == 'Ducking') && (AnimFrame > -0.03) )
if ( (Physics == PHYS_Walking) && (GetAnimGroup(AnimSequence) == 'Ducking') && (AnimFrame > -0.03) )
{
maxZ = Location.Z + 0.3 * CollisionHeight; // default value is 0.3
if ( HitLocation.Z > maxZ )
{
if ( TraceDir.Z >= 0 )
return false;
adjZ = (maxZ - HitLocation.Z)/TraceDir.Z;
HitLocation.Z = maxZ;
HitLocation.X = HitLocation.X + TraceDir.X * adjZ;
HitLocation.Y = HitLocation.Y + TraceDir.Y * adjZ;
delta = (HitLocation - Location) * vect(1,1,0);
if (delta dot delta > CollisionRadius * CollisionRadius)
return false;
}
maxZ = Location.Z + 0.3 * CollisionHeight; // default game is 0.25
if ( HitLocation.Z <= maxZ )
return true;

if ( TraceDir.Z >= 0 )
return false;

adjZ = (maxZ - HitLocation.Z)/TraceDir.Z;
HitLocation.Z = maxZ;
HitLocation.X = HitLocation.X + TraceDir.X * adjZ;
HitLocation.Y = HitLocation.Y + TraceDir.Y * adjZ;
delta = (HitLocation - Location) * vect(1,1,0);
if (delta dot delta > CollisionRadius * CollisionRadius)
return false;
}
return true;
}
Expand Down Expand Up @@ -5468,6 +5467,12 @@ function xxPlayerTickEvents()

if (Level.NetMode == NM_Client)
{
if (ConsoleCommand("get ini:engine.engine.gamerenderdevice SmoothMaskedTextures") ~= "true") {
// SmoothMaskedTextures makes certain textures see-through
// --> force it off
ConsoleCommand("set ini:engine.engine.gamerenderdevice SmoothMaskedTextures False");
}

if (!zzbInitialized)
{
zzbInitialized = true;
Expand Down Expand Up @@ -5768,12 +5773,12 @@ event PreRender( canvas zzCanvas )
if (GameReplicationInfo.bTeamGame && PlayerReplicationInfo.Team == zzPRI.Team) {
if (Settings.DesiredTeamSkinFemale > 8 && zzPRI.bIsFemale)
zzPRI.Owner.AnimRate = 1.35*1.55 * FMax(0.35, zzPRI.Owner.Region.Zone.ZoneGravity.Z/zzPRI.Owner.Region.Zone.Default.ZoneGravity.Z);
else if (Settings.DesiredTeamSkin <= 8 && zzPRI.bIsFemale == false)
else if (Settings.DesiredTeamSkin >= 0 && Settings.DesiredTeamSkin <= 8 && zzPRI.bIsFemale == false)
zzPRI.Owner.AnimRate = 1.35/1.55 * FMax(0.35, zzPRI.Owner.Region.Zone.ZoneGravity.Z/zzPRI.Owner.Region.Zone.Default.ZoneGravity.Z);
} else {
if (Settings.DesiredSkinFemale > 8 && zzPRI.bIsFemale)
zzPRI.Owner.AnimRate = 1.35*1.55 * FMax(0.35, zzPRI.Owner.Region.Zone.ZoneGravity.Z/zzPRI.Owner.Region.Zone.Default.ZoneGravity.Z);
else if (Settings.DesiredSkin <= 8 && zzPRI.bIsFemale == false)
else if (Settings.DesiredSkin >= 0 && Settings.DesiredSkin <= 8 && zzPRI.bIsFemale == false)
zzPRI.Owner.AnimRate = 1.35/1.55 * FMax(0.35, zzPRI.Owner.Region.Zone.ZoneGravity.Z/zzPRI.Owner.Region.Zone.Default.ZoneGravity.Z);
}
}
Expand Down Expand Up @@ -6654,7 +6659,7 @@ simulated function xxClientSpawnSSRBeamInternal(vector HitLocation, vector Smoke

if (Settings.BeamOriginMode == 1) {
// Show beam originating from its Owner
OriginLocation = Owner.Location + SmokeOffset;
OriginLocation = O.Location + SmokeOffset;
} else {
// Show beam originating from where it was shot
OriginLocation = SmokeLocation;
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -447,14 +447,14 @@ Extract the zipped files to your system folder.
Remove any mention in your ServerPackages and ServerActors of TimTim's NewNet or Deepu's Ultimate NewNet.
Add the following lines to your server's **UnrealTournament.ini** under **[Engine.GameEngine]**:

**ServerPackages=InstaGibPlus5B**
**ServerActors=InstaGibPlus5B.NewNetServer**
**ServerActors=InstaGibPlus5B.PureStats**
**ServerPackages=InstaGibPlus5C**
**ServerActors=InstaGibPlus5C.NewNetServer**
**ServerActors=InstaGibPlus5C.PureStats**

<b>It is highly recommended to set your server's tickrate to 100.</b>

# Usage
For InstaGib, make sure the mutator **InstaGibPlus5B.NewNetIG** is loaded via your map vote configuration or during server launch.
For InstaGib, make sure the mutator **InstaGibPlus5C.NewNetIG** is loaded via your map vote configuration or during server launch.

InstaGib+ has minimal weapons code and will load the default UT weapons if the NewNetIG mutator is not loaded, so it is absolutely unusable in normal weapons, make sure to use it only if your objective is to play or to run an InstaGib centered server.

Expand Down Expand Up @@ -922,8 +922,8 @@ If False, players will be slowed down to ground speed upon landing, which preven
# Building

1. Go to the installation directory of UT99 in a command shell
2. Use `git clone https://github.com/utspect/InstaGibPlus InstaGibPlus5B` to clone the repo
3. Navigate to the newly created directory `InstaGibPlus5B`
2. Use `git clone https://github.com/utspect/InstaGibPlus InstaGibPlus5C` to clone the repo
3. Navigate to the newly created directory `InstaGibPlus5C`
4. Execute `build.bat`
5. The result of the build process will be available in the `System` folder that is next to `build.bat`

Expand Down
5 changes: 0 additions & 5 deletions System/InstaGibPlus5B.int

This file was deleted.

5 changes: 5 additions & 0 deletions System/InstaGibPlus5C.int
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[Public]
Object=(Name=InstaGibPlus5C.UTPure,Class=Class,MetaClass=Engine.Mutator,Description="IG+5C UTPure,InstaGibPlus5C UTPure")
Object=(Name=InstaGibPlus5C.ST_Mutator,Class=Class,MetaClass=Engine.Mutator,Description="IG+5C ST_Mutator,InstaGibPlus5C ST_Mutator")
Object=(Name=InstaGibPlus5C.NewNetIG,Class=Class,MetaClass=Engine.Mutator,Description="IG+5C NewNetIG,InstaGibPlus5C NewNetIG")
Object=(Name=InstaGibPlus5C.NewNetSA,Class=Class,MetaClass=Engine.Mutator,Description="IG+5C NewNetSA,InstaGibPlus5C NewNetSA")
2 changes: 1 addition & 1 deletion make.ini
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ EditPackages=Botpack
EditPackages=UTServerAdmin
EditPackages=UTMenu
EditPackages=UTBrowser
EditPackages=InstaGibPlus5B
EditPackages=InstaGibPlus5C

[Core.System]
Paths=*.u
Expand Down

0 comments on commit c55b6af

Please sign in to comment.