saetor creation fixed
This commit is contained in:
@@ -784,6 +784,9 @@ public class PlayerCharacter extends AbstractCharacter {
|
|||||||
// Verify Race
|
// Verify Race
|
||||||
int raceID = msg.getRace();
|
int raceID = msg.getRace();
|
||||||
|
|
||||||
|
if(raceID == 0)
|
||||||
|
raceID = 1999;
|
||||||
|
|
||||||
Race race = Race.getRace(raceID);
|
Race race = Race.getRace(raceID);
|
||||||
|
|
||||||
if (race == null) {
|
if (race == null) {
|
||||||
@@ -816,33 +819,34 @@ public class PlayerCharacter extends AbstractCharacter {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Verify HairStyle/BeardStyle/SkinColor/HairColor/BeardColor
|
// Verify HairStyle/BeardStyle/SkinColor/HairColor/BeardColor
|
||||||
int hairStyleID = msg.getHairStyle();
|
int hairStyleID = msg.getHairStyle();
|
||||||
int beardStyleID = msg.getBeardStyle();
|
int beardStyleID = msg.getBeardStyle();
|
||||||
int skinColorID = msg.getSkinColor();
|
int skinColorID = msg.getSkinColor();
|
||||||
int hairColorID = msg.getHairColor();
|
int hairColorID = msg.getHairColor();
|
||||||
int beardColorID = msg.getBeardColor();
|
int beardColorID = msg.getBeardColor();
|
||||||
|
|
||||||
if (!race.isValidHairStyle(hairStyleID)) {
|
if(raceID != 1999) {
|
||||||
Logger.info("Invalid HairStyleID: " + hairStyleID + " for race: " + race.getName());
|
if (!race.isValidHairStyle(hairStyleID)) {
|
||||||
return null;
|
Logger.info("Invalid HairStyleID: " + hairStyleID + " for race: " + race.getName());
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!race.isValidSkinColor(skinColorID)) {
|
||||||
|
Logger.info("Invalid skinColorID: " + skinColorID + " for race: " + race.getName());
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!race.isValidHairColor(hairColorID)) {
|
||||||
|
Logger.info("Invalid hairColorID: " + hairColorID + " for race: " + race.getName());
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!race.isValidBeardColor(beardColorID)) {
|
||||||
|
Logger.info("Invalid beardColorID: " + beardColorID + " for race: " + race.getName());
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!race.isValidSkinColor(skinColorID)) {
|
|
||||||
Logger.info("Invalid skinColorID: " + skinColorID + " for race: " + race.getName());
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!race.isValidHairColor(hairColorID)) {
|
|
||||||
Logger.info("Invalid hairColorID: " + hairColorID + " for race: " + race.getName());
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!race.isValidBeardColor(beardColorID)) {
|
|
||||||
Logger.info("Invalid beardColorID: " + beardColorID + " for race: " + race.getName());
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get stat modifiers
|
// Get stat modifiers
|
||||||
int strMod = msg.getStrengthMod();
|
int strMod = msg.getStrengthMod();
|
||||||
int dexMod = msg.getDexterityMod();
|
int dexMod = msg.getDexterityMod();
|
||||||
@@ -1123,9 +1127,15 @@ public class PlayerCharacter extends AbstractCharacter {
|
|||||||
int kitID = msg.getKit();
|
int kitID = msg.getKit();
|
||||||
|
|
||||||
// get the correctKit
|
// get the correctKit
|
||||||
int raceClassID = Kit.GetKitIDByRaceClass(raceID, baseClassID);
|
int raceClassID;
|
||||||
|
if(raceID != 1999){
|
||||||
|
raceClassID = Kit.GetKitIDByRaceClass(raceID, baseClassID);
|
||||||
|
}else{
|
||||||
|
raceClassID = Kit.GetKitIDByRaceClass(2011, baseClassID);
|
||||||
|
}
|
||||||
ArrayList<Kit> allKits = Kit.RaceClassIDMap.get(raceClassID);
|
ArrayList<Kit> allKits = Kit.RaceClassIDMap.get(raceClassID);
|
||||||
|
|
||||||
|
|
||||||
Kit kit = null;
|
Kit kit = null;
|
||||||
|
|
||||||
for (Kit k : allKits) {
|
for (Kit k : allKits) {
|
||||||
@@ -1155,6 +1165,13 @@ public class PlayerCharacter extends AbstractCharacter {
|
|||||||
clientConnection);
|
clientConnection);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
if(raceID == 1999){
|
||||||
|
hairStyleID = 0;
|
||||||
|
beardStyleID = 0;
|
||||||
|
skinColorID = 0;
|
||||||
|
hairColorID = 0;
|
||||||
|
beardColorID = 0;
|
||||||
|
}
|
||||||
|
|
||||||
// Make PC
|
// Make PC
|
||||||
PlayerCharacter pcWithoutID = new PlayerCharacter(firstName, lastName, (short) strMod, (short) dexMod, (short) conMod,
|
PlayerCharacter pcWithoutID = new PlayerCharacter(firstName, lastName, (short) strMod, (short) dexMod, (short) conMod,
|
||||||
|
|||||||
Reference in New Issue
Block a user