Skip to content

Commit 53bb1f4

Browse files
committed
file renaming / deletion, code cleanup
1 parent 649133f commit 53bb1f4

File tree

2 files changed

+25
-127
lines changed

2 files changed

+25
-127
lines changed

src/simulation/elements/182.cpp

Lines changed: 0 additions & 111 deletions
This file was deleted.

src/simulation/elements/polo.cpp renamed to src/simulation/elements/POLO.cpp

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,14 @@ int Element_POLO::update(UPDATE_FUNC_ARGS)
5151
const int cooldown = 15;
5252
const int limit = 5;
5353

54-
int r, s;
55-
r = sim->photons[y][x];
56-
if(parts[i].tmp < limit && !parts[i].life)
54+
int r = sim->photons[y][x];
55+
if (parts[i].tmp < limit && !parts[i].life)
5756
{
5857
if (!(rand()%1000) &&!parts[i].tmp)
5958
{
60-
s = sim->create_part(-3, x, y, PT_NEUT);
61-
if(s >= 0) {
59+
int s = sim->create_part(-3, x, y, PT_NEUT);
60+
if (s >= 0)
61+
{
6262
parts[i].life = cooldown;
6363
parts[i].tmp ++;
6464

@@ -68,9 +68,11 @@ int Element_POLO::update(UPDATE_FUNC_ARGS)
6868
}
6969

7070

71-
if (!(rand()%10000)) {
72-
s = sim->create_part(-3, x, y, PT_NEUT);
73-
if(s >= 0) {
71+
if (!(rand()%10000))
72+
{
73+
int s = sim->create_part(-3, x, y, PT_NEUT);
74+
if (s >= 0)
75+
{
7476
parts[i].temp = ((parts[i].temp + parts[r>>8].temp + parts[r>>8].temp) + 600.0f) / 3.0f;
7577
parts[i].life = cooldown;
7678
parts[i].tmp ++;
@@ -83,30 +85,37 @@ int Element_POLO::update(UPDATE_FUNC_ARGS)
8385
}
8486
}
8587
}
86-
if (parts[i].tmp2 >= 20) {
88+
if (parts[i].tmp2 >= 20)
89+
{
8790
sim->part_change_type(i,x,y,PT_PLUT);
8891
parts[i].temp = (parts[i].temp+600.0f)/2.0f;
8992
return 1;
9093
}
91-
if (parts[r>>8].type == PT_PROT) {
94+
if (parts[r>>8].type == PT_PROT)
95+
{
9296
parts[i].tmp2 ++;
9397
sim->kill_part(r>>8);
9498
}
95-
if (parts[i].temp <388.15f) {
96-
if (388.15f-parts[i].temp >= 0.2f) {
99+
if (parts[i].temp < 388.15f)
100+
{
101+
if (parts[i].temp >= 388.15f-0.2f)
102+
{
97103
parts[i].temp += 0.2f;
98-
} else {
99-
parts[i].temp += 388.15f-parts[i].temp; //no overheating!
104+
}
105+
else
106+
{
107+
//no overheating!
108+
parts[i].temp += 388.15f-parts[i].temp;
100109
}
101110
}
102111
return 0;
103112
}
104113

105-
106114
//#TPT-Directive ElementHeader Element_POLO static int graphics(GRAPHICS_FUNC_ARGS)
107115
int Element_POLO::graphics(GRAPHICS_FUNC_ARGS)
108116
{
109-
if(cpart->tmp >= 5) {
117+
if (cpart->tmp >= 5)
118+
{
110119
*colr = 0x70;
111120
*colg = 0x70;
112121
*colb = 0x70;

0 commit comments

Comments
 (0)