Actor Tom Sizemore has been ordered to spend another 30 days in a drug rehabilitation centre.
Tom Sizemore will be allowed out the clinic for work
The Saving Private Ryan actor was first ordered to stay there two months ago after he admitted violating the terms of his probation for drug possession.
Superior Court Judge Paula Mabrey told Sizemore in July he could face prison if he failed to make progress at the clinic, near Los Angeles.
The 43-year-old actor pleaded guilty in October to drug possession charges.
At the hearing in July Sizemore admitted several violations of the terms of his probation.
These included falsifying his urine tests and failing to submit to drug testing on eight occasions.
He checked himself into the live-in rehabilitation centre in Pasadena on 11 July, ahead of the hearing, where Judge Mabrey ordered him to stay.
At the court hearing on Thursday, she said Sizemore will be allowed out for occasional work assignments.
But he must have an immediate drug test each time he returns, she ruled.
"This next month should prove to us that you're going to stay sober - clean and sober - and work at the same time," Judge Mabrey said.
A report from his doctor said Sizemore was taking his treatment "seriously", she added.
Another hearing was set for 17 October.
Sizemore, who has six-week old twins, told reporters outside the court: "I'm very, very proud to be a father.
"I just want to put this very difficult time behind me, although I feel that what doesn't kill you in fact makes you a stronger person, and I just want to live a long healthy life and be a good dad."