/*
-Copyright (C) 2004 Parallel Realities
+Copyright (C) 2004-2011 Parallel Realities
+Copyright (C) 2011-2015 Perpendicular Dimensions
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
return false;
}
+bool Map::isValid(int x, int y)
+{
+ if (x >= 0 && y >= 0 && x < MAPWIDTH && y < MAPHEIGHT)
+ return true;
+
+ return false;
+}
+
bool Map::isSolid(int x, int y)
{
+ if (!isValid(x, y))
+ return false;
+
if ((data[x][y] >= MAP_BREAKABLE) && (data[x][y] < MAP_DECORATION))
{
return true;
bool Map::isBreakable(int x, int y)
{
+ if (!isValid(x, y))
+ return false;
+
if ((data[x][y] >= MAP_BREAKABLE) && (data[x][y] <= MAP_BREAKABLE2))
{
return true;
bool Map::isNoReset(int x, int y)
{
+ if (!isValid(x, y))
+ return false;
+
if ((data[x][y] >= MAP_NORESET) && (data[x][y] < MAP_DECORATION))
{
return true;
bool Map::isLiquid(int x, int y)
{
+ if (!isValid(x, y))
+ return false;
+
if (data[x][y] == 0)
{
return false;
bool Map::isTopLayer(int x, int y)
{
+ if (!isValid(x, y))
+ return false;
+
if (data[x][y] >= MAP_TOPLAYER)
{
return true;
if (strcmp(p->stageName, name) == 0)
{
- strncpy(p->stageName, "@none@", sizeof p->stageName);
+ strlcpy(p->stageName, "@none@", sizeof p->stageName);
p->clear();
return;
}
void Map::setName(const char *name)
{
- strncpy(this->name, name, sizeof this->name);
+ strlcpy(this->name, name, sizeof this->name);
if (strstr(name, "BioMech"))
{