From: MirceaKitsune Date: Sat, 16 Jul 2011 23:46:35 +0000 (+0300) Subject: Fix the swallow model not showing to spectators when spectating a player. Also do... X-Git-Url: http://de.git.xonotic.org/?p=voretournament%2Fvoretournament.git;a=commitdiff_plain;h=983b00f54d3cf7ce3d7f2118d9fbf8ba8846bae9 Fix the swallow model not showing to spectators when spectating a player. Also do some other fixes to the swallow models. --- diff --git a/data/qcsrc/server/vore.qc b/data/qcsrc/server/vore.qc index cda4791e..484e689b 100644 --- a/data/qcsrc/server/vore.qc +++ b/data/qcsrc/server/vore.qc @@ -204,9 +204,19 @@ void Vore_AutoDigest(entity e) } .entity swallow_model; +float Vore_SwallowModel_CustomizeEntityForClient() +{ + // use the same system as the weapon model + self.viewmodelforclient = self.owner; + if(other.classname == "spectator") + if(other.enemy == self.owner) + self.viewmodelforclient = other; + return TRUE; +} + void Vore_SwallowModel_Think() { - //update the position of the swallow model to match our swallow progress + // update the position of the swallow model to match our swallow progress float dist; dist = (-0.5 + self.owner.swallow_progress_prey) * cvar("g_vore_swallowmodel_range"); // the model is centered at 0.5 progress if(cvar("g_healthsize")) @@ -232,18 +242,12 @@ void Vore_SwallowModel_Update(entity prey, entity pred) if(!prey.swallow_model) { prey.swallow_model = spawn(); - prey.swallow_model.movetype = MOVETYPE_FOLLOW; prey.swallow_model.solid = SOLID_NOT; - - // apply the properties of the prey - prey.swallow_model.viewmodelforclient = prey; // use the same system as the weapon model //prey.swallow_model.effects |= EF_NOGUNBOB; // let it bob prey.swallow_model.effects |= EF_NODEPTHTEST; // don't hide behind walls - prey.swallow_model.colormap = prey.colormap; // pants and shirt color - prey.swallow_model.glowmod = prey.glowmod; // glow color - - prey.swallow_model.owner = prey; // owned by the prey + prey.swallow_model.owner = prey; + prey.swallow_model.customizeentityforclient = Vore_SwallowModel_CustomizeEntityForClient; prey.swallow_model.think = Vore_SwallowModel_Think; prey.swallow_model.nextthink = time; } @@ -259,6 +263,10 @@ void Vore_SwallowModel_Update(entity prey, entity pred) prey.swallow_model.scale = pred.scale / prey.scale; // player size difference if(prey.swallow_model.enemy != pred) prey.swallow_model.enemy = pred; // enemy is the predator + if(prey.swallow_model.colormap != pred.colormap) + prey.swallow_model.colormap = pred.colormap; // pants and shirt color + if(prey.swallow_model.glowmod != pred.glowmod) + prey.swallow_model.glowmod = pred.glowmod; // glow color } .entity pusher; diff --git a/docs/Release notes.txt b/docs/Release notes.txt index c884af1f..b71dc0f6 100644 --- a/docs/Release notes.txt +++ b/docs/Release notes.txt @@ -250,4 +250,6 @@ Bug fixes: - Fix the server attempting to attach the exterior weapon entity to stomach models. Should fix console warnings and the weapon model blinking for predators. +- Fix the swallow model not showing to spectators when spectating a player. Also do some other fixes to the swallow models. + - Disable GLSL color control by default. This MIGHT fix the white screen problem some people have been reporting.