Fix crash bugs in liquids and tiletypes.

develop
Petr Mrázek 2011-08-15 01:30:15 +02:00
parent a0f99ef707
commit 292074116e
3 changed files with 6 additions and 4 deletions

@ -78,5 +78,6 @@ IF(UNIX)
ELSEIF(WIN32)
SET(CPACK_GENERATOR "ZIP")
ENDIF()
set(CPACK_INCLUDE_TOPLEVEL_DIRECTORY 0)
set(CPACK_PACKAGE_FILE_NAME "dfhack-${DF_VERSION}-r${DFHACK_RELEASE}-${CMAKE_SYSTEM_NAME}")
INCLUDE(CPack)

@ -192,7 +192,6 @@ DFhackCExport command_result df_liquids (Core * c, vector <string> & parameters)
int width = 1, height = 1, z_levels = 1;
while(!end)
{
c->Resume();
string command = "";
std::stringstream str;
str <<"[" << mode << ":" << brushname << ":" << amount << ":" << flowmode << ":" << setmode << "]#";
@ -271,14 +270,14 @@ DFhackCExport command_result df_liquids (Core * c, vector <string> & parameters)
width = command == "" ? width : atoi (command.c_str());
if(width < 1) width = 1;
str.clear();
str.str("");
str << " :set range height<" << height << "># ";
c->con.lineedit(str.str(),command,range_hist);
range_hist.add(command);
height = command == "" ? height : atoi (command.c_str());
if(height < 1) height = 1;
str.clear();
str.str("");
str << " :set range z-levels<" << z_levels << "># ";
c->con.lineedit(str.str(),command,range_hist);
range_hist.add(command);

@ -605,7 +605,9 @@ DFhackCExport command_result df_tiletypes (Core * c, vector <string> & parameter
}
int32_t type = DFHack::findTileType(shape, material, source->variant, special, source->direction);
map.setTiletypeAt(*iter, type);
// make sure it's not invalid
if(type != -1)
map.setTiletypeAt(*iter, type);
// Remove liquid from walls, etc
if (!DFHack::FlowPassable(shape))