Archived copy of war3source.com, the War3Source forum (2009–2020), rebuilt from the Internet Archive by wc3mods.net. This page was captured on 2012-10-25 (original capture). Forum · All archived topics · Wiki · Bug tracker · Blog
Chat

War3:Source
October 24, 2012, 10:54:52 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Download: http://war3source.com/index.php?board=9.0
What is War3Source?: http://war3source.com/index.php?topic=200.0
Sample Stats: http://war3source.com/war3stats
Steam Community Group: http://steamcommunity.com/groups/war3source
War3Source SVN Checkout: http://ownageclan.com/svn/war3source/
War3Source servers: http://www.game-monitor.com/search.php?vars=war3_version=
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Add MAX_NAME_LENGTH constants to w3s interface  (Read 374 times)
Frenzzy
Full Member
***
Posts: 217


337905984 frenzzy@live.ru
View Profile WWW
« on: June 06, 2011, 05:29:52 PM »

Please add MAX_NAME_LENGTH constants to w3s interface.
I think it will help to make fewer errors in addons.
Examples:

#define MAX_RACE_SHORTNAME 32
#define MAX_RACE_FULLNAME 64

#define MAX_ITEM_SHORTNAME 32
#define MAX_ITEM_FULLNAME 64

..and ect.
Logged

O_o
Ownz
Developer
Administrator
Hero Member
*****
Posts: 2046



View Profile WWW Email
« Reply #1 on: June 06, 2011, 05:57:50 PM »

shortname should be only 16
Logged

DarkEnergy
Frenzzy
Full Member
***
Posts: 217


337905984 frenzzy@live.ru
View Profile WWW
« Reply #2 on: June 06, 2011, 06:17:46 PM »

This is just an example. I want to use this constants and not think about the max length of names :о)
Logged

O_o
Glider⠠⠵
Global Moderator
Sr. Member
*****
Posts: 413


⠠⠵


View Profile
« Reply #3 on: June 06, 2011, 09:06:41 PM »

Code:
public NWar3_CreateNewRace(Handle:plugin,numParams){


decl String:name[64],String:shortname[16];
GetNativeString(1,name,sizeof(name));
GetNativeString(2,shortname,sizeof(shortname));

//W3Log("add race %s %s",name,shortname);

return CreateNewRace(name,shortname);

}

What actually happens when you pass something that is larger than 16/64 characters? Does it actually throw an error or does it just cut up the string? If there's no error then I suggest adding the constants and throwing a real error.


Also what the heck are your races called if your shortnames are longer than 16 characters Cheesy?
Logged

Ownz
Developer
Administrator
Hero Member
*****
Posts: 2046



View Profile WWW Email
« Reply #4 on: June 06, 2011, 09:11:07 PM »

it gets truncated
Logged

DarkEnergy
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!