Jump to content
Eternal Lands Official Forums
Sign in to follow this  
crusadingknight

Patch: Make Your Guild Member's Tags Change Colors

Recommended Posts

This patch just changes the color of the tags of people in your guild, currently to purple. The diff is on BerliOS.de, and I've posted it here (because I hate having to do unix2dos)

Okay, the diff is:

--- elc/elc/new_actors.c	Sun Aug 29 17:26:29 2004
+++ new_actors.c	Sat Sep 11 09:58:24 2004
@@ -4,6 +4,8 @@
#include "global.h"

glow_color glow_colors[10];
+//our guild
+char my_guild[10];

//build the glow color table
void build_glow_color_table()
@@ -640,9 +642,38 @@
 	}

 my_strncp(actors_list[i]->actor_name,&in_data[28],30);
+	//If this is us, get our guild, make it purple
+	int guild_loc=check_guild(actors_list[i]->actor_name);
+	char * guild_ptr;
+	if(guild_loc != 0) {
+     guild_ptr=&(actors_list[i]->actor_name[guild_loc+1]);
+     if(actor_id==yourself) {
+          strcpy(my_guild, guild_ptr);
+        }    
+  	//Is this our guild? if so, make it purple    
+        if(!strcmp(my_guild, guild_ptr)) {
+             actors_list[i]->actor_name[guild_loc]=146;//Deep purple
+        }
+    }        
 if(caps_filter && my_isupper(actors_list[i]->actor_name, -1)) my_tolower(actors_list[i]->actor_name);
 unlock_actors_lists();  //unlock it

}

-
+//Return whether they are in our guild+tag location
+int check_guild(const char * name_str) {
+    char name[45], guild[10];
+    int i, j, len = strlen (name_str);
+    memset (name, 0, 40);
+    memset (guild, 0, 5);
+    for (i = 0; i < len; i++)
+        if ((unsigned char) name_str[i] == 143) break;
+    if (i < len) {
+    /* player has a guild tag */
+        return (i);
+    }
+    /* player has no guild tag */
+    else
+        return 0;
+}        
+

For anyone like iway, who doesn't compile but browse the forums on teh ebil WIngdows anyway, it's at http://www.freewebs.com/theironguard/elc.zip (This also has everything else in the current CVS in it, so no, I'm not overreacting to my own patch B) )

Share this post


Link to post
Share on other sites
Guest Zeplin

nice =)

I like this patch, can be easily expanded into the other idea, with enemy guilds listing.

Share this post


Link to post
Share on other sites
Actually I think this patch should be added to the official version...

Look by me post something here lord vermor get patch installed in game :ph34r:

 

anyone know why 4 error when installed this patch

compline log is this

Compiling...

new_actors.c

new_actors.c(232) : warning C4244: 'function' : conversion from 'double' to 'GLfloat', possible loss of data

new_actors.c(232) : warning C4244: 'function' : conversion from 'double' to 'GLfloat', possible loss of data

new_actors.c(232) : warning C4244: 'function' : conversion from 'double' to 'GLfloat', possible loss of data

new_actors.c(265) : warning C4244: 'function' : conversion from 'double' to 'GLfloat', possible loss of data

new_actors.c(265) : warning C4244: 'function' : conversion from 'double' to 'GLfloat', possible loss of data

new_actors.c(265) : warning C4244: 'function' : conversion from 'double' to 'GLfloat', possible loss of data

new_actors.c(610) : warning C4244: 'function' : conversion from 'double' to 'float', possible loss of data

new_actors.c(610) : warning C4244: 'function' : conversion from 'double' to 'float', possible loss of data

new_actors.c(610) : warning C4244: 'function' : conversion from 'double' to 'float', possible loss of data

new_actors.c(610) : warning C4244: 'function' : conversion from 'double' to 'float', possible loss of data

new_actors.c(648) : error C2143: syntax error : missing ';' before 'type'

new_actors.c(649) : error C2143: syntax error : missing ';' before 'type'

new_actors.c(650) : error C2065: 'guild_loc' : undeclared identifier

new_actors.c(651) : error C2065: 'guild_ptr' : undeclared identifiernew_actors.c(651) : warning C4047: '=' : 'int' differs in levels of indirection from 'char *'

new_actors.c(653) : warning C4047: 'function' : 'const char *' differs in levels of indirection from 'int'

new_actors.c(656) : warning C4047: 'function' : 'const char *' differs in levels of indirection from 'int'

 

Build log was saved at "file://c:\James\complie el source code\Copy (2) of elc\Release\BuildLog.htm"

elc - 4 error(s), 13 warning(s)

 

 

---------------------- Done ----------------------

 

    Build: 0 succeeded, 1 failed, 0 skipped

 

and source code area where error is below here

}

 

line 646 my_strncp(actors_list->actor_name,&in_data[28],30);

line 647      //If this is us, get our guild, make it purple

line 648        int guild_loc=check_guild(actors_list->actor_name);

line 649      char * guild_ptr;

line 650      if(guild_loc != 0) {

line 651      guild_ptr=&(actors_list->actor_name[guild_loc+1]);line 652        if(actor_id==yourself) {

line 653      strcpy(my_guild, guild_ptr);

line 654                  }   

line 655        //Is this our guild? if so, make it purple   

line 656                if(!strcmp(my_guild, guild_ptr)) {

line 657              actors_list->actor_name[guild_loc]=146;//Deep purple

line 658                }

line 659            }

if(caps_filter && my_isupper(actors_list->actor_name, -1)) my_tolower(actors_list->actor_name);

unlock_actors_lists();  //unlock it

 

}

just thought let you know that at least got error when installed in source code and compline under microsoft visual c++ on windows xp

Share this post


Link to post
Share on other sites

No clue how well it patches with the current version, but it works fine on mine...

Share this post


Link to post
Share on other sites

As I said the problem is that you are declaring variables in the middle of the code. The C89 specification does not allow this, and that's why VC is giving errors and not other compilers.

Share this post


Link to post
Share on other sites

Perhaps you should use:

-Wdeclaration-after-statement

to ensure that it'd always compile on compilers that don't fully support the C99 standard..

Share this post


Link to post
Share on other sites
Perhaps you should use:

-Wdeclaration-after-statement

cc1: Invalid option `-Wdeclaration-after-statement'

 

Compilers that don't support C99 don't support the warning either.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×