質問編集履歴
1
文章を修正しました。
title
CHANGED
File without changes
|
body
CHANGED
@@ -6,6 +6,7 @@
|
|
6
6
|
|
7
7
|
|
8
8
|
```cpp
|
9
|
+
|
9
10
|
//弾との当たり判定
|
10
11
|
for (std::vector<MapObject>::iterator it = Area.begin(); it != Area.end();)
|
11
12
|
{
|
@@ -18,13 +19,20 @@
|
|
18
19
|
|
19
20
|
switch (type)
|
20
21
|
{
|
21
|
-
///////////////////////////////////////////////////////////////////////////
|
22
|
+
///////////////////////////////////////////////////////////////////////////
|
22
|
-
|
23
23
|
//レンガ
|
24
24
|
case ObjectType::Brick:
|
25
25
|
{
|
26
26
|
it = Area.erase(it);
|
27
27
|
|
28
|
+
if (it == Area.end())
|
29
|
+
{
|
30
|
+
break;
|
31
|
+
}
|
32
|
+
else {
|
33
|
+
it++;
|
34
|
+
}
|
35
|
+
|
28
36
|
}
|
29
37
|
break;
|
30
38
|
|
@@ -32,10 +40,16 @@
|
|
32
40
|
case ObjectType::Block:
|
33
41
|
{
|
34
42
|
it = Area.erase(it);
|
43
|
+
if (it == Area.end())
|
44
|
+
{
|
45
|
+
break;
|
46
|
+
}
|
47
|
+
else {
|
48
|
+
it++;
|
49
|
+
}
|
50
|
+
}
|
51
|
+
//////////////////////////////////////////////////////////////////////////
|
35
52
|
|
36
|
-
|
37
|
-
}
|
38
|
-
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
39
53
|
}
|
40
54
|
|
41
55
|
}
|
@@ -53,5 +67,4 @@
|
|
53
67
|
it++;
|
54
68
|
}
|
55
69
|
}
|
56
|
-
|
57
70
|
```
|