mirror of
https://github.com/electronicarts/CNC_TS_and_RA2_Mission_Editor.git
synced 2025-07-21 14:44:52 -04:00
fixed sometimes basenode cannot be drawn correctly. (e.g. allied infantry barracks) .
This commit is contained in:
parent
204bdf0ea3
commit
2a9edd868c
2 changed files with 12 additions and 6 deletions
|
@ -5585,14 +5585,21 @@ void CIsoView::DrawMap()
|
|||
}
|
||||
|
||||
|
||||
if (m.node.type > -1) {
|
||||
if (m.node.type >= 0) {
|
||||
last_succeeded_operation = 10102;
|
||||
|
||||
CString house = m.node.house;
|
||||
CString tmp;
|
||||
|
||||
if (Map->GetNodeAt(mapCoords + MapVec(1, 0), tmp) != m.node.index && Map->GetNodeAt(mapCoords + MapVec(0, 1), tmp) != m.node.index) {
|
||||
const auto drawCoordsBld = GetRenderTargetCoordinates(mapCoords - MapVec(buildinginfo[m.node.type].h - 1, buildinginfo[m.node.type].w - 1));
|
||||
bool shouldDraw = true;
|
||||
auto const leftNodeIdx = Map->GetNodeAt(mapCoords + MapVec(-1, 0), tmp);
|
||||
auto const rightNodeIdx = Map->GetNodeAt(mapCoords + MapVec(0, -1), tmp);
|
||||
if (leftNodeIdx == m.node.index || rightNodeIdx == m.node.index) {
|
||||
shouldDraw = false;
|
||||
}
|
||||
|
||||
if (shouldDraw) {
|
||||
const auto drawCoordsBld = GetRenderTargetCoordinates(mapCoords);
|
||||
|
||||
COLORREF c;
|
||||
c = GetColor(house);
|
||||
|
|
|
@ -1756,9 +1756,8 @@ void CMapData::UpdateNodes(BOOL bSave)
|
|||
int x = atoi(sx);
|
||||
int y = atoi(sy);
|
||||
int bid = buildingid[type];
|
||||
int d, f;
|
||||
for (d = 0; d < buildinginfo[bid].h; d++) {
|
||||
for (f = 0; f < buildinginfo[bid].w; f++) {
|
||||
for (auto d = 0; d < buildinginfo[bid].h; d++) {
|
||||
for (auto f = 0; f < buildinginfo[bid].w; f++) {
|
||||
int pos = x + d + (y + f) * GetIsoSize();
|
||||
fielddata[pos].node.type = buildingid[type];
|
||||
fielddata[pos].node.house = id;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue