Skip to content
This repository has been archived by the owner on Jan 11, 2025. It is now read-only.

Commit

Permalink
Fix a bug that causes can't load level in level editor
Browse files Browse the repository at this point in the history
  • Loading branch information
acmepjz committed May 3, 2011
1 parent 6bae3c7 commit 91970a6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/LevelEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@ void LevelEditor::GUIEventCallback_OnEvent(std::string Name,GUIObject* obj,int n
GUIObjectRoot=NULL;
}
//
FILE *f=fopen(s.c_str(),"rt");
FILE *f=fopen(ProcessFileName(s).c_str(),"rt");
if(!f){
GUIObjectRoot=new GUIObject(100,200,600,200,GUIObjectFrame,"Error");
GUIObjectRoot->ChildControls.push_back(new GUIObject(8,20,584,42,GUIObjectLabel,string("Can't open file "+s+".").c_str()));
Expand All @@ -606,7 +606,7 @@ void LevelEditor::GUIEventCallback_OnEvent(std::string Name,GUIObject* obj,int n
GUIObjectRoot=NULL;
}
//TODO:overwrite prompt
FILE *f=fopen(s.c_str(),"wt");
FILE *f=fopen(ProcessFileName(s).c_str(),"wt");
if(!f){
GUIObjectRoot=new GUIObject(100,200,600,200,GUIObjectFrame,"Error");
GUIObjectRoot->ChildControls.push_back(new GUIObject(8,20,584,42,GUIObjectLabel,string("Can't open file "+s+".").c_str()));
Expand Down

0 comments on commit 91970a6

Please sign in to comment.