mirror of
https://github.com/1dot13/source.git
synced 2026-09-16 14:47:17 +02:00
Brief: //dnl ch84
- Solve issues related to my recent editor fixes. Details: - Fix missing condition when using keyboard for load any map from listed profiles in CTRL+L list box. - Fix CTD during gWorldItems resize after adding certain amount of items. git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6867 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
+23
-1
@@ -903,6 +903,8 @@ void HandleMainKeyEvents( InputAtom *pEvent )
|
|||||||
iCurrFileShown = iTotalFiles - 1;
|
iCurrFileShown = iTotalFiles - 1;
|
||||||
else if( iTopFileShown < iCurrFileShown-7 )
|
else if( iTopFileShown < iCurrFileShown-7 )
|
||||||
iTopFileShown++;
|
iTopFileShown++;
|
||||||
|
else if( iTopFileShown > iCurrFileShown )//dnl ch84 290114
|
||||||
|
iTopFileShown = iCurrFileShown;
|
||||||
break;
|
break;
|
||||||
case HOME:
|
case HOME:
|
||||||
case CTRL_HOME:
|
case CTRL_HOME:
|
||||||
@@ -940,10 +942,30 @@ void HandleMainKeyEvents( InputAtom *pEvent )
|
|||||||
curr = curr->pNext;
|
curr = curr->pNext;
|
||||||
x++;
|
x++;
|
||||||
}
|
}
|
||||||
if( curr )
|
if( curr )
|
||||||
{
|
{
|
||||||
SetInputFieldStringWith8BitString( 0, curr->FileInfo.zFileName );
|
SetInputFieldStringWith8BitString( 0, curr->FileInfo.zFileName );
|
||||||
swprintf( gzFilename, L"%S", curr->FileInfo.zFileName );
|
swprintf( gzFilename, L"%S", curr->FileInfo.zFileName );
|
||||||
|
//dnl ch84 290114
|
||||||
|
if(ValidFilename())
|
||||||
|
SetInputFieldStringWith16BitString(0, gzFilename);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SetInputFieldStringWith16BitString(0, L"");
|
||||||
|
wcscpy(gzFilename, L"");
|
||||||
|
}
|
||||||
|
#ifdef USE_VFS
|
||||||
|
gzProfileName[0] = 0;
|
||||||
|
while(curr = curr->pPrev)
|
||||||
|
{
|
||||||
|
if(curr->FileInfo.zFileName[0] == '<')
|
||||||
|
{
|
||||||
|
strcpy(gzProfileName, &curr->FileInfo.zFileName[2]);
|
||||||
|
gzProfileName[strlen(gzProfileName)-2] = 0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,6 +28,9 @@
|
|||||||
#include "map screen interface map inventory.h" // added by Flugente
|
#include "map screen interface map inventory.h" // added by Flugente
|
||||||
#include "connect.h"
|
#include "connect.h"
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef JA2EDITOR//dnl ch84 290114
|
||||||
|
#include "Item Statistics.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
//Global dynamic array of all of the items in a loaded map.
|
//Global dynamic array of all of the items in a loaded map.
|
||||||
std::vector<WORLDITEM> gWorldItems;//dnl ch75 261013
|
std::vector<WORLDITEM> gWorldItems;//dnl ch75 261013
|
||||||
@@ -451,8 +454,21 @@ void ResizeWorldItems(void)//dnl ch75 271013
|
|||||||
guiNumWorldItems = gWorldItems.size();
|
guiNumWorldItems = gWorldItems.size();
|
||||||
if(guiNumWorldItems - GetNumUsedWorldItems() < 50)
|
if(guiNumWorldItems - GetNumUsedWorldItems() < 50)
|
||||||
{
|
{
|
||||||
|
#ifdef JA2EDITOR//dnl ch84 290114
|
||||||
|
WORLDITEM *pwi, *pwinew;
|
||||||
|
if(!gWorldItems.empty())
|
||||||
|
pwi = &gWorldItems.front();
|
||||||
|
#endif
|
||||||
gWorldItems.resize(guiNumWorldItems + 100);
|
gWorldItems.resize(guiNumWorldItems + 100);
|
||||||
guiNumWorldItems = gWorldItems.size();
|
guiNumWorldItems = gWorldItems.size();
|
||||||
|
#ifdef JA2EDITOR//dnl ch84 290114
|
||||||
|
if(gpItem)
|
||||||
|
{
|
||||||
|
pwinew = &gWorldItems.front();
|
||||||
|
if(pwi != pwinew)
|
||||||
|
gpItem = (OBJECTTYPE *)((PSTR)pwinew + ((PSTR)gpItem - (PSTR)pwi));
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user