Bug in wc3:ft

Want to talk about war3ft or make suggestions? Post them here

Moderator: Forum Moderator

Locked
User avatar
DarkAngel
Militia
Posts: 70
Joined: Fri Oct 07, 2005 11:04 am
Location: Germany
Contact:

Bug in wc3:ft

Post by DarkAngel » Mon Jun 30, 2008 8:51 am

Heyho,

Sorry that I post here but if I go under Bug reports then comes there I have no access to that section...

Whatever. I think I've found a "bug" in wc3ft. If you look in the war3ft.inl then you will find there the function wc3_bevorespawn.
This function will called for every player bevore the spawn. Allright. But you load in wc3_bevorespawn the function SHARED_CopySavedWeapons for every player although you only need to load this function once per round. And the ID parameter is useless there I think.

Thanks for attentation.
DarkAngel aka DA
Developer of the UWC3 Next Generation mod.
http://www.fun-arena.com

User avatar
Geesu
<b>King of the world!</b>
Posts: 3159
Joined: Tue Jul 05, 2005 9:24 pm
Contact:

Re: Bug in wc3:ft

Post by Geesu » Mon Jun 30, 2008 8:55 am

You don't need to load it once per round... You need to load it EVERY time a weapon changes...

Also - what issue are you having on the bug report section? you can't login?
No Support via PM

User avatar
DarkAngel
Militia
Posts: 70
Joined: Fri Oct 07, 2005 11:04 am
Location: Germany
Contact:

Re: Bug in wc3:ft

Post by DarkAngel » Mon Jun 30, 2008 9:31 am

Geesu wrote:You don't need to load it once per round... You need to load it EVERY time a weapon changes...

Also - what issue are you having on the bug report section? you can't login?
I talk about SHARED_CopySavedWeapons NOT SHARED_SaveWeapons.
Look in the shared.inl you will see the problem...

I'm already logged in.

Code: Select all

You are not authorised to read this forum.
Developer of the UWC3 Next Generation mod.
http://www.fun-arena.com

User avatar
Geesu
<b>King of the world!</b>
Posts: 3159
Joined: Tue Jul 05, 2005 9:24 pm
Contact:

Re: Bug in wc3:ft

Post by Geesu » Mon Jun 30, 2008 10:56 am

What link are you clicking when it says that?

Also - I don't entirely understand what the issue is - where are you saying it should copy instead? And why? I believe it's currently working fine.
No Support via PM

User avatar
DarkAngel
Militia
Posts: 70
Joined: Fri Oct 07, 2005 11:04 am
Location: Germany
Contact:

Re: Bug in wc3:ft

Post by DarkAngel » Mon Jun 30, 2008 12:07 pm

events.inl - In the EVENT_NewRound()

Code: Select all

// User's have not spawned yet, so lets do some pre-spawn things
	new players[32], numplayers, i;
	get_players( players, numplayers );
	for ( i = 0; i < numplayers; i++ )
	{
		WC3_BeforeSpawn( players[i] );
	}
You loop through all players and start for every player the WC3_BeforeSpawn function. That's okay. Now look in the WC3_BeforeSpawn function.

Code: Select all

// Save a copy of what weapons the user had the previous round (for weapon reincarnation)
	SHARED_CopySavedWeapons( id );
Here we are in a critical situation. You start for every player this function:

Code: Select all

// Copy the weapons over right before reset hud is called, that way we don't lose our last round weapons when the round restarts
public SHARED_CopySavedWeapons( id )
{
	for ( new i = 0; i < 33; i++ )
	{
		for ( new j = 0; j < 32; j++ )
		{
			g_PlayerLastWeapons[i][j] = g_PlayerWeapons[i][j];
		}
	}
}
This function copy one array to another array. But you do this for every player. I think your first idea of this function was this:

Code: Select all

// Copy the weapons over right before reset hud is called, that way we don't lose our last round weapons when the round restarts
public SHARED_CopySavedWeapons( id )
{
	for ( new j = 0; j < 32; j++ )
	{
		g_PlayerLastWeapons[id][j] = g_PlayerWeapons[id][j];
	}
}
Now you understand? It's actually not a bug but it takes many CPU usage...
What link are you clicking when it says that?
The link on the forumindex. But I see you have fixed it. Thanks :)
Developer of the UWC3 Next Generation mod.
http://www.fun-arena.com

User avatar
Geesu
<b>King of the world!</b>
Posts: 3159
Joined: Tue Jul 05, 2005 9:24 pm
Contact:

Re: Bug in wc3:ft

Post by Geesu » Mon Jun 30, 2008 12:35 pm

haha I get it now :P that's a funny bug - can you add to bug reports pls? :-)

Opps
No Support via PM

User avatar
DarkAngel
Militia
Posts: 70
Joined: Fri Oct 07, 2005 11:04 am
Location: Germany
Contact:

Re: Bug in wc3:ft

Post by DarkAngel » Mon Jun 30, 2008 12:49 pm

Done. :)
Developer of the UWC3 Next Generation mod.
http://www.fun-arena.com

Locked