Skip to content

Commit

Permalink
Fixed weird issue stopping execution even though exception was caught…
Browse files Browse the repository at this point in the history
… properly
  • Loading branch information
Wiggy boy committed Jul 16, 2017
1 parent 6722740 commit fd5a7cb
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 37 deletions.
8 changes: 7 additions & 1 deletion changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ Table of content,
Bugs & Fixes
3.0.1.6
Bugs & Fixes
3.0.1.7
Bugs & Fixes

------------------------------------------------------------------------------

Expand Down Expand Up @@ -142,8 +144,12 @@ Table of content,
== Bugs & Fixes ==
- Fixed a bug causing a various amount of Heroes not to appear. (further development from 3.0.1.4)

3.0.1.5
3.0.1.6
== Bugs & Fixes ==
- Fixed a bug causing a various amount of Heroes not to appear. (further development from 3.0.1.5)
- Changed download links from updates etc, dropbox has stopped support static share links. (Do note the installer.jar still broken).

3.0.1.7
== Bugs & Fixes ==
- Fixed some weird issue stopping execution because of weird reasons, even thuogh exception was properly caught.

72 changes: 37 additions & 35 deletions src/Engine/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -1178,43 +1178,45 @@ else if(orgelements.size() != modelements.size()) {
String orgeffect = fixPath(orgelements.get(nn).getAttribute("effect"),filepath[0]);
String modeffect = fixPath(modelements.get(nn).getAttribute("effect"),filepath[1]);

try {
LLFile file = new LLFile(folder+modeffect.substring(1));
if(!(file.length() > 0)) {
StringBuilder sb = new StringBuilder();
ZipEntry zipentry = resources.getEntry(orgeffect.substring(1));

if(zipentry == null) {
main.log.print("Failed to find the specific resource "+orgeffect);
continue;
if (!orgeffect.isEmpty() && !modeffect.isEmpty()) {
try {
LLFile file = new LLFile(folder+modeffect.substring(1));
if(!(file.length() > 0)) {
StringBuilder sb = new StringBuilder();
ZipEntry zipentry = resources.getEntry(orgeffect.substring(1));

if(zipentry == null) {
main.log.print("Failed to find the specific resource "+orgeffect);
continue;
}

LLInputStream in2 = new LLInputStream(resources.getInputStream(zipentry)); //Same case as for 3 lines above;
while(in2.available() > 0) {
sb.append(in2.readString(4*4*1024));
}
String effect = sb.toString();

//Fixing the paths...
String path = orgeffect.replaceFirst("/\\w+\\.{1}effect","/");

effect = effect.replace("sample=\"","sample=\""+path);
effect = effect.replace("material=\"","material=\""+path);
effect = effect.replace("model=\"","model=\""+path);

effect = effect.replaceAll(path+"/","/");
while(effect.contains("/../")) {
effect = effect.replaceFirst("/\\w+/\\.{2}/","/");
}

//And now finally, time to output!
LLOutputStream ut = new LLOutputStream(new FileOutputStream(file));
ut.writeString(stamp(effect));
ut.close();
}

LLInputStream in2 = new LLInputStream(resources.getInputStream(zipentry)); //Same case as for 3 lines above;
while(in2.available() > 0) {
sb.append(in2.readString(4*4*1024));
}
String effect = sb.toString();

//Fixing the paths...
String path = orgeffect.replaceFirst("/\\w+\\.{1}effect","/");

effect = effect.replace("sample=\"","sample=\""+path);
effect = effect.replace("material=\"","material=\""+path);
effect = effect.replace("model=\"","model=\""+path);

effect = effect.replaceAll(path+"/","/");
while(effect.contains("/../")) {
effect = effect.replaceFirst("/\\w+/\\.{2}/","/");
}

//And now finally, time to output!
LLOutputStream ut = new LLOutputStream(new FileOutputStream(file));
ut.writeString(stamp(effect));
ut.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
/* else if(orgelements.get(nn).getTagName().equalsIgnoreCase("spawnprojectile")) {
Expand Down
2 changes: 1 addition & 1 deletion src/Engine/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public static void main(String[] args) {
//STATIC variables;
public static final String NAME = "Customization of Newerth";
public static final String BRANCH = "The New Age";
public static final String VERSION = "3.0.1.6";
public static final String VERSION = "3.0.1.7";
public static final String PATH = System.getenv("APPDATA")+File.separator+"Lindholm"+File.separator+NAME+File.separator;

//Variables;
Expand Down

0 comments on commit fd5a7cb

Please sign in to comment.