home
·
contact
·
privacy
projects
/
plomrogue
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
a18ffcf
)
Server/C: Don't update map memory on WORLD_ACTIVE command.
author
Christian Heller
<c.heller@plomlompom.de>
Sun, 8 Mar 2015 16:14:53 +0000
(17:14 +0100)
committer
Christian Heller
<c.heller@plomlompom.de>
Sun, 8 Mar 2015 16:14:53 +0000
(17:14 +0100)
src/server/field_of_view.c
patch
|
blob
|
history
src/server/field_of_view.h
patch
|
blob
|
history
src/server/god_commands.c
patch
|
blob
|
history
src/server/init.c
patch
|
blob
|
history
src/server/run.c
patch
|
blob
|
history
diff --git
a/src/server/field_of_view.c
b/src/server/field_of_view.c
index dc60442e3ff28a835d462f5e3ca877b5c938fa2c..45c90e6c0a6f6dc7da76db9938c529f8124076b2 100644
(file)
--- a/
src/server/field_of_view.c
+++ b/
src/server/field_of_view.c
@@
-308,7
+308,7
@@
static void add_things_to_map_memory(struct Thing * t_eye)
-extern void update_map_memory(struct Thing * t_eye)
+extern void update_map_memory(struct Thing * t_eye
, uint8_t age_map
)
{
if (!t_eye->mem_map)
{
{
if (!t_eye->mem_map)
{
@@
-330,7
+330,8
@@
extern void update_map_memory(struct Thing * t_eye)
}
continue;
}
}
continue;
}
- if ( '0' <= t_eye->mem_depth_map[i] && '9' > t_eye->mem_depth_map[i]
+ if (age_map &&
+ '0' <= t_eye->mem_depth_map[i] && '9' > t_eye->mem_depth_map[i]
&& !(rrand() % (uint16_t) pow(2, t_eye->mem_depth_map[i] - 48)))
{
t_eye->mem_depth_map[i]++;
&& !(rrand() % (uint16_t) pow(2, t_eye->mem_depth_map[i] - 48)))
{
t_eye->mem_depth_map[i]++;
diff --git
a/src/server/field_of_view.h
b/src/server/field_of_view.h
index 54ffe289d676eba9360c79950d36f94889710dfa..be6324bff170c8a9bdc2babd622edf6fc4cd2c63 100644
(file)
--- a/
src/server/field_of_view.h
+++ b/
src/server/field_of_view.h
@@
-18,7
+18,7
@@
struct Thing;
/* Update "t_eye"'s .mem_map memory with what's in its current FOV, and update
* and age the .mem_depth_map.
*/
/* Update "t_eye"'s .mem_map memory with what's in its current FOV, and update
* and age the .mem_depth_map.
*/
-extern void update_map_memory(struct Thing * t_eye);
+extern void update_map_memory(struct Thing * t_eye
, uint8_t age_map
);
/* Build "t"'s field of view. */
extern void build_fov_map(struct Thing * t);
/* Build "t"'s field of view. */
extern void build_fov_map(struct Thing * t);
diff --git
a/src/server/god_commands.c
b/src/server/god_commands.c
index d91cea32d01e848d711401f2ff068ac5f1ae7d4b..0dbf1a3ddee552d498383d44c05b5b8915421b74 100644
(file)
--- a/
src/server/god_commands.c
+++ b/
src/server/god_commands.c
@@
-257,7
+257,7
@@
static uint8_t parse_position(char* tok0, char * tok1, struct Thing * t)
build_fov_map(t);
if (t == get_player())
{
build_fov_map(t);
if (t == get_player())
{
- update_map_memory(t);
+ update_map_memory(t
, 1
);
}
}
}
}
}
}
@@
-386,7
+386,7
@@
static uint8_t parse_world_active(char * tok0, char * tok1)
build_fov_map(ti);
if (ti == get_player())
{
build_fov_map(ti);
if (ti == get_player())
{
- update_map_memory(ti);
+ update_map_memory(ti
, 0
);
}
}
}
}
}
}
diff --git
a/src/server/init.c
b/src/server/init.c
index 43a4d685a5477a2a375f9e7c2fc4c08b6f4c5a86..f5c81d3d5081b3ec4ed48f43eeb1801f94f86789 100644
(file)
--- a/
src/server/init.c
+++ b/
src/server/init.c
@@
-209,7
+209,7
@@
extern uint8_t remake_world()
break;
}
}
break;
}
}
- update_map_memory(get_player());
+ update_map_memory(get_player()
, 1
);
for (tt = world.thing_types; tt; tt = tt->next)
{
if (world.player_type != tt->id)
for (tt = world.thing_types; tt; tt = tt->next)
{
if (world.player_type != tt->id)
diff --git
a/src/server/run.c
b/src/server/run.c
index 4351b9ffce236b57dd89752a41d87a878fbb5551..ad04f711db0aac65a8d7951779f210136f8d8e97 100644
(file)
--- a/
src/server/run.c
+++ b/
src/server/run.c
@@
-327,7
+327,7
@@
static void turn_over()
{
if (0 == thing->command)
{
{
if (0 == thing->command)
{
- update_map_memory(thing);
+ update_map_memory(thing
, 1
);
if (thing == player)
{
break;
if (thing == player)
{
break;