summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortrojal <trojal@gmail.com>2013-02-04 05:41:10 -0800
committertrojal <trojal@gmail.com>2013-02-04 05:41:10 -0800
commit36de442965e31129560401ea3a0d81f9ecb6a2da (patch)
treeff8a3f3236ae7d449ef343d77d07f01084417fcc
parent524291493e64196d8ce02f4b637ea0ee1a176d0a (diff)
parent7e4c57861434f07dcba240db541e1f90cfebe694 (diff)
downloadhercules-36de442965e31129560401ea3a0d81f9ecb6a2da.tar.gz
hercules-36de442965e31129560401ea3a0d81f9ecb6a2da.tar.bz2
hercules-36de442965e31129560401ea3a0d81f9ecb6a2da.tar.xz
hercules-36de442965e31129560401ea3a0d81f9ecb6a2da.zip
Merge pull request #7 from akrus/master
Getting rid of unneeded indexes & allowing uint for guild exp values
-rw-r--r--sql-files/main.sql16
-rw-r--r--src/char/int_guild.c4
2 files changed, 7 insertions, 13 deletions
diff --git a/sql-files/main.sql b/sql-files/main.sql
index f159260f1..e69279710 100644
--- a/sql-files/main.sql
+++ b/sql-files/main.sql
@@ -111,7 +111,6 @@ CREATE TABLE IF NOT EXISTS `char` (
KEY `account_id` (`account_id`),
KEY `party_id` (`party_id`),
KEY `guild_id` (`guild_id`),
- KEY `name` (`name`),
KEY `online` (`online`)
) ENGINE=MyISAM AUTO_INCREMENT=150000;
@@ -181,8 +180,7 @@ CREATE TABLE IF NOT EXISTS `hotkey` (
`type` TINYINT(1) unsigned NOT NULL default '0',
`itemskill_id` INT(11) unsigned NOT NULL default '0',
`skill_lvl` TINYINT(4) unsigned NOT NULL default '0',
- PRIMARY KEY (`char_id`,`hotkey`),
- INDEX (`char_id`)
+ PRIMARY KEY (`char_id`,`hotkey`)
) ENGINE=MyISAM;
--
@@ -196,8 +194,7 @@ CREATE TABLE IF NOT EXISTS `global_reg_value` (
`type` tinyint(1) NOT NULL default '3',
`account_id` int(11) unsigned NOT NULL default '0',
PRIMARY KEY (`char_id`,`str`,`account_id`),
- KEY `account_id` (`account_id`),
- KEY `char_id` (`char_id`)
+ KEY `account_id` (`account_id`)
) ENGINE=MyISAM;
--
@@ -310,8 +307,7 @@ CREATE TABLE IF NOT EXISTS `guild_position` (
`name` varchar(24) NOT NULL default '',
`mode` tinyint(11) unsigned NOT NULL default '0',
`exp_mode` tinyint(11) unsigned NOT NULL default '0',
- PRIMARY KEY (`guild_id`,`position`),
- KEY `guild_id` (`guild_id`)
+ PRIMARY KEY (`guild_id`,`position`)
) ENGINE=MyISAM;
--
@@ -622,8 +618,7 @@ CREATE TABLE IF NOT EXISTS `skill` (
`char_id` int(11) unsigned NOT NULL default '0',
`id` smallint(11) unsigned NOT NULL default '0',
`lv` tinyint(4) unsigned NOT NULL default '0',
- PRIMARY KEY (`char_id`,`id`),
- KEY `char_id` (`char_id`)
+ PRIMARY KEY (`char_id`,`id`)
) ENGINE=MyISAM;
--
@@ -634,8 +629,7 @@ CREATE TABLE IF NOT EXISTS `skill_homunculus` (
`homun_id` int(11) NOT NULL,
`id` int(11) NOT NULL,
`lv` smallint(6) NOT NULL,
- PRIMARY KEY (`homun_id`,`id`),
- KEY `homun_id` (`homun_id`)
+ PRIMARY KEY (`homun_id`,`id`)
) ENGINE=MyISAM;
--
diff --git a/src/char/int_guild.c b/src/char/int_guild.c
index 9cb17dca8..b3a907b1a 100644
--- a/src/char/int_guild.c
+++ b/src/char/int_guild.c
@@ -602,9 +602,9 @@ static struct guild_castle* inter_guildcastle_fromsql(int castle_id)
// Read exp_guild.txt
static bool exp_guild_parse_row(char* split[], int column, int current)
{
- int exp = atoi(split[0]);
+ unsigned int exp = atoll(split[0]);
- if (exp < 0 || exp >= INT_MAX) {
+ if (exp < 0 || exp >= UINT_MAX) {
ShowError("exp_guild: Invalid exp %d at line %d\n", exp, current);
return false;
}