mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-07-12 23:54:24 +01:00
Merge pull request #2936 from Neerti/1/17/2017_two_bugfixes
Two bugfixes
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
#define NEWSFILE "data/news.sav" //where the memos are saved
|
||||
|
||||
/client/
|
||||
var/last_news_hash = null // Stores a hash of the last news window it saw, which gets compared to the current one to see if it is different.
|
||||
//var/last_news_hash = null // Stores a hash of the last news window it saw, which gets compared to the current one to see if it is different.
|
||||
|
||||
// Returns true if news was updated since last seen.
|
||||
/client/proc/check_for_new_server_news()
|
||||
var/savefile/F = get_server_news()
|
||||
if(F)
|
||||
if(md5(F["body"]) != last_news_hash)
|
||||
if(md5(F["body"]) != prefs.lastnews)
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
|
||||
@@ -8,12 +8,14 @@
|
||||
|
||||
/datum/category_item/player_setup_item/player_global/settings/load_preferences(var/savefile/S)
|
||||
S["lastchangelog"] >> pref.lastchangelog
|
||||
S["lastnews"] >> pref.lastnews
|
||||
S["default_slot"] >> pref.default_slot
|
||||
S["preferences"] >> pref.preferences_enabled
|
||||
S["preferences_disabled"] >> pref.preferences_disabled
|
||||
|
||||
/datum/category_item/player_setup_item/player_global/settings/save_preferences(var/savefile/S)
|
||||
S["lastchangelog"] << pref.lastchangelog
|
||||
S["lastnews"] << pref.lastnews
|
||||
S["default_slot"] << pref.default_slot
|
||||
S["preferences"] << pref.preferences_enabled
|
||||
S["preferences_disabled"] << pref.preferences_disabled
|
||||
@@ -47,6 +49,7 @@
|
||||
pref.preferences_disabled -= key
|
||||
|
||||
pref.lastchangelog = sanitize_text(pref.lastchangelog, initial(pref.lastchangelog))
|
||||
pref.lastnews = sanitize_text(pref.lastnews, initial(pref.lastnews))
|
||||
pref.default_slot = sanitize_integer(pref.default_slot, 1, config.character_slots, initial(pref.default_slot))
|
||||
|
||||
/datum/category_item/player_setup_item/player_global/settings/content(var/mob/user)
|
||||
|
||||
@@ -114,6 +114,8 @@ datum/preferences
|
||||
var/datum/category_collection/player_setup_collection/player_setup
|
||||
var/datum/browser/panel
|
||||
|
||||
var/lastnews // Hash of last seen lobby news content.
|
||||
|
||||
/datum/preferences/New(client/C)
|
||||
player_setup = new(src)
|
||||
set_biological_gender(pick(MALE, FEMALE))
|
||||
@@ -262,7 +264,7 @@ datum/preferences
|
||||
if(be_random_name)
|
||||
real_name = random_name(identifying_gender,species)
|
||||
|
||||
// Ask the preferences datums to apply their own settings to the new mob
|
||||
// Ask the preferences datums to apply their own settings to the new mob
|
||||
player_setup.copy_to_mob(character)
|
||||
|
||||
if(icon_updates)
|
||||
|
||||
@@ -843,3 +843,9 @@ mob/observer/dead/MayRespawn(var/feedback = 0)
|
||||
|
||||
if(finalized == "No")
|
||||
icon_state = previous_state
|
||||
|
||||
/mob/observer/dead/is_blind()
|
||||
return FALSE
|
||||
|
||||
/mob/observer/dead/is_deaf()
|
||||
return FALSE
|
||||
|
||||
@@ -291,7 +291,8 @@
|
||||
return
|
||||
var/savefile/F = get_server_news()
|
||||
if(F)
|
||||
client.last_news_hash = md5(F["body"])
|
||||
client.prefs.lastnews = md5(F["body"])
|
||||
client.prefs.save_preferences()
|
||||
|
||||
var/dat = "<html><body><center>"
|
||||
dat += "<h1>[F["title"]]</h1>"
|
||||
|
||||
Reference in New Issue
Block a user