Overwrite objects that overlap each other

Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
master
sigonasr2 2 years ago
parent 1b803a151d
commit 0c3c453b23
  1. BIN
      C++ProjectTemplate
  2. 26
      main.cpp
  3. 2
      save0

Binary file not shown.

@ -2138,8 +2138,8 @@ void SeasonI::keyUpdates() {
} }
} }
if (LeftPressed()) { if (LeftPressed()) {
OVERWORLD_POWER_SELECTION_MEMBER=-1;
if (PARTY_MEMBER_COUNT==1) { if (PARTY_MEMBER_COUNT==1) {
OVERWORLD_POWER_SELECTION_MEMBER=-1;
GAME_STATE=GameState::OVERWORLD_MENU; GAME_STATE=GameState::OVERWORLD_MENU;
} else { } else {
GAME_STATE=GameState::OVERWORLD_POWER_PLAYER_MENU; GAME_STATE=GameState::OVERWORLD_POWER_PLAYER_MENU;
@ -2416,13 +2416,19 @@ void SeasonI::keyUpdates() {
if (EDITING_LAYER==layer::ENCOUNTER&&GetMouse(0).bPressed) { if (EDITING_LAYER==layer::ENCOUNTER&&GetMouse(0).bPressed) {
for (int i=0;i<CURRENT_MAP->encounters.size();i++) { for (int i=0;i<CURRENT_MAP->encounters.size();i++) {
if(CURRENT_MAP->encounters[i]->pos==(vd2d)HIGHLIGHTED_TILE*32) { if(CURRENT_MAP->encounters[i]->pos==(vd2d)HIGHLIGHTED_TILE*32) {
EDITING_ENCOUNTER=CURRENT_MAP->encounters[i]; for (int j=0;j<CURRENT_MAP->encounters[i]->objs.size();j++) {
TextEntryEnable(true); int index=CURRENT_MAP->encounters[i]->objs[j]->obj->objArrElement;
break; delete OBJECTS[index];
OBJECTS.erase(OBJECTS.begin()+index);
for (int k=0;k<OBJECTS.size();k++) {
OBJECTS[k]->objArrElement=k;
}
}
delete CURRENT_MAP->encounters[i];
CURRENT_MAP->encounters.erase(CURRENT_MAP->encounters.begin()+i--);
continue;
} }
} }
} else
if (EDITING_LAYER==layer::ENCOUNTER&&GetMouse(0).bPressed) {
LoadEncounter(CURRENT_MAP,HIGHLIGHTED_TILE*32,ENCOUNTER_LIST[ENCOUNTER_SELECTED]->chance,ENCOUNTER_SELECTED,true); LoadEncounter(CURRENT_MAP,HIGHLIGHTED_TILE*32,ENCOUNTER_LIST[ENCOUNTER_SELECTED]->chance,ENCOUNTER_SELECTED,true);
} else } else
if (EDITING_LAYER==layer::ENCOUNTER&&GetMouse(1).bPressed) { if (EDITING_LAYER==layer::ENCOUNTER&&GetMouse(1).bPressed) {
@ -2443,6 +2449,14 @@ void SeasonI::keyUpdates() {
} }
} else } else
if (EDITING_LAYER==layer::OBJECT&&GetMouse(0).bPressed) { if (EDITING_LAYER==layer::OBJECT&&GetMouse(0).bPressed) {
for (int i=0;i<OBJECTS.size();i++) {
if (OBJECTS[i]->GetPos()==(vd2d)HIGHLIGHTED_TILE*32) {
delete OBJECTS[i];
OBJECTS.erase(OBJECTS.begin()+i--);
} else {
OBJECTS[i]->objArrElement=i;
}
}
AddObjectToWorld(CreateObject(SELECTED_OBJ_ID,HIGHLIGHTED_TILE*32)); AddObjectToWorld(CreateObject(SELECTED_OBJ_ID,HIGHLIGHTED_TILE*32));
} else } else
if (EDITING_LAYER==layer::OBJECT&&GetMouse(1).bReleased) { if (EDITING_LAYER==layer::OBJECT&&GetMouse(1).bReleased) {

@ -1 +1 @@
120 120 PLAYER 30 30 8 8 4 0 0 0 0 0 0 0 11 9 10 13 14 15 16 17 33 29 21 25 1 6 4 3 -1 -1 -1 334 202 120 120 NESS 30 30 8 8 4 0 0 0 0 0 0 0 6 33 34 29 30 31 32 0 3 -1 -1 -1 321 202 120 120 PAULA 30 30 8 8 4 0 0 0 0 0 0 0 6 21 22 23 24 37 38 0 3 -1 -1 -1 309 202 120 120 JEFF 30 30 8 8 4 0 0 0 0 0 0 0 1 0 0 3 -1 -1 -1 -999 -999 120 120 ANNA 30 30 8 8 4 0 0 0 0 0 0 0 4 21 25 26 29 0 3 -1 -1 -1 297 202 120 120 KING 30 30 8 8 4 0 0 0 0 0 0 0 1 0 0 3 -1 -1 -1 -999 -999 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0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 5183 PLAYER 0 120 120 PLAYER 30 30 8 8 4 0 0 0 0 0 0 0 11 9 10 13 14 15 16 17 33 29 21 25 1 4 6 3 -1 -1 -1 365 288 120 120 NESS 30 30 8 8 4 0 0 0 0 0 0 0 6 33 34 29 30 31 32 0 3 -1 -1 -1 354 277 120 120 PAULA 30 30 8 8 4 0 0 0 0 0 0 0 6 21 22 23 24 37 38 0 3 -1 -1 -1 342 277 120 120 JEFF 30 30 8 8 4 0 0 0 0 0 0 0 1 0 0 3 -1 -1 -1 -999 -999 120 120 ANNA 30 30 8 8 4 0 0 0 0 0 0 0 4 21 25 26 29 0 3 -1 -1 -1 330 277 120 120 KING 30 30 8 8 4 0 0 0 0 0 0 0 1 0 0 3 -1 -1 -1 -999 -999 120 120 POO 30 30 8 8 4 0 0 0 0 0 0 0 1 0 0 3 -1 -1 -1 -999 -999 66 6 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 6 8 3 3 3 10 10 10 10 12 12 12 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4 2 2 2 2 2 2 2 2 5 11 512 1 1 0 0 1 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0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