2025-07-21 00:51 CEST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0000299Spring engineGeneralpublic2007-04-04 22:22
Reporterrattle 
Assigned Totvo 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionfixed 
Product Version 
Target VersionFixed in Version 
Summary0000299: [patch] Teamcolours flip randomly around when using s3o projectiles with team colours.
DescriptionSituation 1: two s3o units battling each other
When two units, using weapons with s3o models which have team colour on it, shoot each other the team colour parts on the projectiles switch randomly around to either one team colour or the other.

Situation 2: two 3do units battling each other and no other s3o belonging to a team are in the game
Instead of switching colours none are drawn at all.


The same happens when you are in first person mode to the unit model in the lower left. Team colours switch around regularly.
Additional InformationMod I've used is my own project. To reproduce this run spring with two s3o units and have them shoot s3o projectiles with team colour textures at each other. Happens in .72 and the current svn build. I included a missile model I made with team colour on the texture for testing purposes.
TagsNo tags attached.
Checked infolog.txt for Errors
Attached Files
  • zip file icon deathhand.zip (100,297 bytes) 2006-09-19 22:09
  • diff file icon WeaponTeamColourFix.diff (1,109 bytes) 2007-03-21 17:55 -
    Index: MissileProjectile.cpp
    ===================================================================
    --- MissileProjectile.cpp	(revision 3483)
    +++ MissileProjectile.cpp	(working copy)
    @@ -71,7 +71,7 @@
     
     	SetRadius(0.0f);
     	if(!weaponDef->visuals.modelName.empty()){
    -		S3DOModel* model = modelParser->Load3DO(string("objects3d/")+weaponDef->visuals.modelName,1,0);
    +		S3DOModel* model = modelParser->Load3DO(string("objects3d/")+weaponDef->visuals.modelName,1,owner->team);
     		if(model){
     			SetRadius(model->radius);
     		}
    Index: WeaponProjectile.cpp
    ===================================================================
    --- WeaponProjectile.cpp	(revision 3483)
    +++ WeaponProjectile.cpp	(working copy)
    @@ -58,7 +58,7 @@
     		interceptHandler.AddShieldInterceptableProjectile(this);
     
     	if(!weaponDef->visuals.modelName.empty()){
    -		S3DOModel* model = modelParser->Load3DO(string("objects3d/")+weaponDef->visuals.modelName,1,0);
    +		S3DOModel* model = modelParser->Load3DO(string("objects3d/")+weaponDef->visuals.modelName,1,owner->team);
     		if(model){
     			s3domodel=model;
     			if(s3domodel->rootobject3do)
    
    diff file icon WeaponTeamColourFix.diff (1,109 bytes) 2007-03-21 17:55 +
  • diff file icon FPSTeamColourFix.diff (362 bytes) 2007-03-22 03:54 -
    Index: UnitDrawer.cpp
    ===================================================================
    --- UnitDrawer.cpp	(revision 3483)
    +++ UnitDrawer.cpp	(working copy)
    @@ -1065,6 +1134,7 @@
     		/* S3O */
     		SetupForS3ODrawing();
     		texturehandler->SetS3oTexture(unit->model->textureType);
    +		SetS3OTeamColour(unit->team);
     		unit->Draw();
     		CleanUpS3ODrawing();
     	}
    
    diff file icon FPSTeamColourFix.diff (362 bytes) 2007-03-22 03:54 +
  • diff file icon WeaponTeamColourFix2.diff (3,037 bytes) 2007-03-22 23:54 -
    Index: MissileProjectile.cpp
    ===================================================================
    --- MissileProjectile.cpp	(revision 3483)
    +++ MissileProjectile.cpp	(working copy)
    @@ -9,6 +9,7 @@
     #include "Game/GameHelper.h"
     #include "myMath.h"
     #include "Rendering/UnitModels/3DModelParser.h"
    +#include "Rendering/UnitModels/UnitDrawer.h"
     #include "Matrix44f.h"
     #include "Sim/Weapons/WeaponDefHandler.h"
     #include "Sync/SyncTracer.h"
    @@ -71,7 +72,7 @@
     
     	SetRadius(0.0f);
     	if(!weaponDef->visuals.modelName.empty()){
    -		S3DOModel* model = modelParser->Load3DO(string("objects3d/")+weaponDef->visuals.modelName,1,0);
    +		S3DOModel* model = modelParser->Load3DO(string("objects3d/")+weaponDef->visuals.modelName,1,owner->team);
     		if(model){
     			SetRadius(model->radius);
     		}
    @@ -373,3 +374,9 @@
     	}
     	return 0;
     }
    +
    +void CMissileProjectile::DrawS3O(void)
    +{
    +	unitDrawer->SetS3OTeamColour(owner->team);
    +	DrawUnitPart();
    +}
    Index: MissileProjectile.h
    ===================================================================
    --- MissileProjectile.h	(revision 3483)
    +++ MissileProjectile.h	(working copy)
    @@ -20,6 +20,7 @@
     	void Update(void);
     	void Draw(void);
     	void DrawUnitPart(void);
    +	void DrawS3O(void);
     	int ShieldRepulse(CPlasmaRepulser* shield,float3 shieldPos, float shieldForce, float shieldMaxSpeed);
     
     	float3 dir;
    Index: WeaponProjectile.cpp
    ===================================================================
    --- WeaponProjectile.cpp	(revision 3483)
    +++ WeaponProjectile.cpp	(working copy)
    @@ -7,6 +7,7 @@
     #include "Rendering/UnitModels/3DOParser.h"
     #include "Rendering/GL/myGL.h"
     #include "Rendering/Textures/TextureHandler.h"
    +#include "Rendering/UnitModels/UnitDrawer.h"
     #include "Game/GameHelper.h"
     #include "LaserProjectile.h"
     #include "FireBallProjectile.h"
    @@ -58,7 +59,7 @@
     		interceptHandler.AddShieldInterceptableProjectile(this);
     
     	if(!weaponDef->visuals.modelName.empty()){
    -		S3DOModel* model = modelParser->Load3DO(string("objects3d/")+weaponDef->visuals.modelName,1,0);
    +		S3DOModel* model = modelParser->Load3DO(string("objects3d/")+weaponDef->visuals.modelName,1,owner->team);
     		if(model){
     			s3domodel=model;
     			if(s3domodel->rootobject3do)
    @@ -215,3 +216,9 @@
     
     	CProjectile::DependentDied(o);
     }
    +
    +void CWeaponProjectile::DrawS3O(void)
    +{
    +	unitDrawer->SetS3OTeamColour(owner->team);
    +	DrawUnitPart();
    +}
    Index: WeaponProjectile.h
    ===================================================================
    --- WeaponProjectile.h	(revision 3483)
    +++ WeaponProjectile.h	(working copy)
    @@ -22,6 +22,7 @@
     	virtual void Collision(CUnit* unit);
     	virtual void Update();
     	virtual void DrawUnitPart();
    +	void DrawS3O(void);
     	virtual int ShieldRepulse(CPlasmaRepulser* shield,float3 shieldPos, float shieldForce, float shieldMaxSpeed){return 0;};	//return 0=unaffected,1=instant repulse,2=gradual repulse
     
     	static CWeaponProjectile *CreateWeaponProjectile(const float3& pos,const float3& speed, CUnit* owner, CUnit *target, const float3 &targetPos, WeaponDef *weaponDef);
    
    diff file icon WeaponTeamColourFix2.diff (3,037 bytes) 2007-03-22 23:54 +

-Relationships
+Relationships

-Notes

~0000804

FLOZi (reporter)

Last edited: 2007-03-22 23:08

They shouldn't switch randomnly at all - they should all use team 0 colour according to the code.

Attached diff should fix situation 1 so that weapons use the teamcolour of their owner. Tested and it works for s3o. Not sure about 3do and situation 2.

Edit: Actually upon further testing it doesn't fix it. I'll take another look.

~0000806

P3374H (reporter)

Similar oddities occur in FPS mode with s3os.

~0000808

FLOZi (reporter)

Last edited: 2007-03-22 03:58

FPSTeamColourFix.diff is a (single line) patch to fix that too :) - atleast with s3os.
I haven't been able to replicate the issue with 3dos anyway, so hopefully they are not an issue.

~0000810

FLOZi (reporter)

New patch WeaponTeamColourFix2.diff *does* fix it. The original patch (WeaponTeamColourFix.diff) can be ignored.

~0000863

tvo (reporter)

Committed, r3544. It seems the one liner had already been committed (by ILMTitan?).
+Notes

-Issue History
Date Modified Username Field Change
2006-09-19 22:09 rattle New Issue
2006-09-19 22:09 rattle File Added: deathhand.zip
2007-03-21 17:54 FLOZi Note Added: 0000804
2007-03-21 17:55 FLOZi File Added: WeaponTeamColourFix.diff
2007-03-22 00:55 P3374H Note Added: 0000806
2007-03-22 03:54 FLOZi File Added: FPSTeamColourFix.diff
2007-03-22 03:54 FLOZi Note Added: 0000808
2007-03-22 03:55 FLOZi Note Edited: 0000808
2007-03-22 03:58 FLOZi Note Edited: 0000808
2007-03-22 23:08 FLOZi Note Edited: 0000804
2007-03-22 23:54 FLOZi File Added: WeaponTeamColourFix2.diff
2007-03-22 23:55 FLOZi Note Added: 0000810
2007-03-25 13:24 tvo Summary Teamcolours flip randomly around when using s3o projectiles with team colours. => [patch] Teamcolours flip randomly around when using s3o projectiles with team colours.
2007-04-04 22:21 tvo Status new => assigned
2007-04-04 22:21 tvo Assigned To => tvo
2007-04-04 22:22 tvo Status assigned => resolved
2007-04-04 22:22 tvo Resolution open => fixed
2007-04-04 22:22 tvo Note Added: 0000863
+Issue History