[MIRROR] Fixes some incorrect uses of rand() [MDB IGNORE] (#19910)

* Fixes some incorrect uses of `rand()` (#74032)

## About The Pull Request

`Rand` only takes integers

![image](https://user-images.githubusercontent.com/51863163/225454770-bdb70aca-ed43-4c17-a943-2ec99720b53d.png)

![image](https://user-images.githubusercontent.com/51863163/225454784-8f9cc053-8e7d-46fd-b6b2-42efb0751d5e.png)

## Why It's Good For The Game

Less misleading code

## Changelog

🆑 Melbert
fix: Lead batteries now start partially drained as intended.
/🆑

* Fixes some incorrect uses of `rand()`

---------

Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com>
This commit is contained in:
SkyratBot
2023-03-18 03:26:13 -07:00
committed by GitHub
co-authored by MrMelbert
parent efe7f5b239
commit c03fc1ffd0
3 changed files with 5 additions and 4 deletions
+2 -1
View File
@@ -41,4 +41,5 @@
/obj/item/stock_parts/cell/lead/Initialize(mapload)
AddElement(/datum/element/update_icon_blocker)
. = ..()
charge = rand(0.2,0.8) * maxcharge
var/initial_percent = rand(20, 80) / 100
charge = initial_percent * maxcharge