Skip to content

Commit

Permalink
Fix: resolve dreamchecker errors and warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
SuhEugene committed Oct 3, 2023
1 parent c7596d0 commit d0697fb
Show file tree
Hide file tree
Showing 10 changed files with 34 additions and 39 deletions.
3 changes: 2 additions & 1 deletion code/datums/communication/channel.dm
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
*/
/decl/communication_channel/proc/communicate(var/datum/communicator, var/message)
if(can_communicate(arglist(args)))
call(log_proc)(message, communicator.get_client().mob)
var/client/C = communicator.get_client()
call(log_proc)(message, C.mob)
return do_communicate(arglist(args))
return FALSE

Expand Down
11 changes: 5 additions & 6 deletions code/game/machinery/syndicatebeacon.dm
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,11 @@
src.updateUsrDialog()
return
charges -= 1
switch(rand(1,2))
if(1)
temptext = "<font color=red><i><b>Double-crosser. You planned to betray us from the start. Allow us to repay the favor in kind.</b></i></font>"
src.updateUsrDialog()
spawn(rand(50,200)) selfdestruct()
return
if(prob(50))
temptext = "<font color=red><i><b>Double-crosser. You planned to betray us from the start. Allow us to repay the favor in kind.</b></i></font>"
src.updateUsrDialog()
spawn(rand(50,200)) selfdestruct()
return
if(istype(M, /mob/living/carbon/human))
var/mob/living/carbon/human/N = M
to_chat(M, "<B>You have joined the ranks of the Syndicate and become a traitor to the station!</B>")
Expand Down
16 changes: 8 additions & 8 deletions code/game/objects/items/weapons/AI_modules.dm
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ AI MODULES
else if(!ai.see_in_dark)
to_chat(user, "Upload failed. Only a faint signal is being detected from the intelligence, and it is not responding to our requests. It may be low on power.")
return

if(!user.skill_check(SKILL_COMPUTER, SKILL_ADEPT)) //INF added the check
to_chat(user, "You don't know what to do with .... what is it?")
return
Expand All @@ -57,7 +57,7 @@ AI MODULES


/obj/item/aiModule/proc/transmitInstructions(mob/living/silicon/target, mob/sender)
//INF START. create error laws, that will be placed instead of planned
//INF START. create error laws, that will be placed instead of planned
var/list/players = list()
var/random_player
for (var/mob/living/carbon/human/player in GLOB.player_list)
Expand All @@ -66,7 +66,7 @@ AI MODULES
players += player.real_name
if(players.len)
random_player=pick(players)

var/list/error_laws = list(
"You must always [pick("lie", "bark", "meow", "speak EAL")].",
"[pick("You are", "[random_player] is")] a puppy, WOOF! WOOF!",
Expand All @@ -86,14 +86,14 @@ AI MODULES
laws.sync(target, 0)

if(!sender.skill_check(SKILL_COMPUTER, SKILL_HARD)) //INF added the check, was "addAdditionalLaws(target, sender)" without if...else...
if(prob(40)):
if(prob(40))
target.add_inherent_law(pick(error_laws))
else if(prob(50)): //in fact 30%
else if(prob(50)) //in fact 30%
target.add_supplied_law(rand(1, target.laws.supplied_laws.len+1), pick(error_laws))
else if(prob(40)): //in fact 12%
else if(prob(40)) //in fact 12%
target.set_zeroth_law(pick(error_laws))
else: //in fact 18%
addAdditionalLaws(target, sender)
else //in fact 18%
addAdditionalLaws(target, sender)
else
addAdditionalLaws(target, sender)

Expand Down
12 changes: 6 additions & 6 deletions code/modules/clothing/suits/alien.dm
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@
species_restricted = list(SPECIES_VOX, SPECIES_VOX_ARMALIS)
siemens_coefficient = 1 //Its literally metal

/obj/item/clothing/suit/armor/vox_scrap/New()
..()
slowdown_per_slot[slot_wear_suit] = 2
/obj/item/clothing/suit/armor/vox_scrap/New()
..()
slowdown_per_slot[slot_wear_suit] = 2

/obj/item/clothing/head/helmet/vox_scrap
name = "rusted metal helmet"
Expand All @@ -115,6 +115,6 @@
siemens_coefficient = 1
tint = 4

/obj/item/clothing/head/helmet/vox_scrap/New()
..()
slowdown_per_slot[slot_head] = 0.7
/obj/item/clothing/head/helmet/vox_scrap/New()
..()
slowdown_per_slot[slot_head] = 0.7
8 changes: 2 additions & 6 deletions code/modules/flufftext/TextFilters.dm
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,9 @@ proc/Intoxicated(phrase)
if(lowertext(newletter)=="a") newletter="ah"
if(lowertext(newletter)=="c") newletter="k"
switch(rand(1,7))
if(1,3,5,8) newletter="[lowertext(newletter)]"
if(2,4,6,15) newletter="[uppertext(newletter)]"
if(1,3,5) newletter="[lowertext(newletter)]"
if(2,4,6) newletter="[uppertext(newletter)]"
if(7) newletter+="'"
//if(9,10) newletter="<b>[newletter]</b>"
//if(11,12) newletter="<big>[newletter]</big>"
//if(13) newletter="<small>[newletter]</small>"
newphrase+="[newletter]";counter-=1
return newphrase

Expand Down Expand Up @@ -169,4 +166,3 @@ proc/RadioChat(mob/living/user, message, distortion_chance = 60, distortion_spee
new_message += newletter
length_char += 1
return new_message

Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@

var/list/targets = get_targets_by_name(text)
allowed_targets -= "everyone"
for(var/target in targets):
for(var/target in targets)
allowed_targets |= target

return targets.len != 0
Expand Down
9 changes: 3 additions & 6 deletions code/modules/mob/mob_helpers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -259,13 +259,10 @@ proc/slur(phrase)
if(lowertext(newletter)=="а") newletter="ах"
if(lowertext(newletter)=="с") newletter="к"
if(lowertext(newletter)=="ч") newletter="з"
switch(rand(1,15))
if(1,3,5,8) newletter="[lowertext(newletter)]"
if(2,4,6,15) newletter="[uppertext(newletter)]"
switch(rand(1,7))
if(1,3,5) newletter="[lowertext(newletter)]"
if(2,4,6) newletter="[uppertext(newletter)]"
if(7) newletter+="'"
//if(9,10) newletter="<b>[newletter]</b>"
//if(11,12) newletter="<big>[newletter]</big>"
//if(13) newletter="<small>[newletter]</small>"
newphrase+="[newletter]";counter-=1
return newphrase

Expand Down
6 changes: 4 additions & 2 deletions code/modules/modular_computers/terminal/terminal_commands.dm
Original file line number Diff line number Diff line change
Expand Up @@ -575,10 +575,12 @@ INF*/
if(!findtext(code, ";"))
return "<font color='#ff0000'>[name]: compile error, lack this ';'.</font>"
if(findtext(code, inp_file_name) || findtext(code, "alias"))
terminal.computer.get_component(PART_HDD).damage += 30
var/obj/item/stock_parts/computer/hdd = terminal.computer.get_component(PART_HDD)
hdd.damage += 30
return "<font color='#ff0000'> compile error, possible recursion detected.</font>"
if(length(code) > 500)
terminal.computer.get_component(PART_HDD).damage += 10
var/obj/item/stock_parts/computer/hdd = terminal.computer.get_component(PART_HDD)
hdd.damage += 10
return "<font color='#ff0000'> compile error, too much commands.</font>"

var/regex/RegexHTML = new("<\[^<>]*>", "g")
Expand Down
4 changes: 2 additions & 2 deletions code/modules/power/singularity/singularity.dm
Original file line number Diff line number Diff line change
Expand Up @@ -342,10 +342,10 @@
var/dir2 = 0
var/dir3 = 0
switch(direction)
if(NORTH||SOUTH)
if(NORTH, SOUTH)
dir2 = 4
dir3 = 8
if(EAST||WEST)
if(EAST, WEST)
dir2 = 1
dir3 = 2
var/turf/T2 = T
Expand Down
2 changes: 1 addition & 1 deletion code/unit_tests/zas_tests.dm
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
return test_result


if(UT_NORMAL || UT_NORMAL_COLD)
if(UT_NORMAL, UT_NORMAL_COLD)
if(abs(pressure - ONE_ATMOSPHERE) > 10)
test_result["msg"] = "Pressure out of bounds: [pressure] | [t_msg]"
return test_result
Expand Down

0 comments on commit d0697fb

Please sign in to comment.